1. Question: What does the following recursive function do, assuming that $x and $y are initially positive integers? function func($x,$y) { if($x <=0) { return $y; } else { return (1 +func($x-1,$y)); } }

    A
    it just returns $y

    B
    it just returns $x

    C
    it computes and returns $x+$y

    D
    it computes and returns $x*$y

    Note: Not available
    1. Report
  2. Question: Which of the following is not used for variable-length argument lists in functions?

    A
    func_num_args()

    B
    func_var_args()

    C
    func_get_arg()

    D
    func_get_args()

    Note: Not available
    1. Report
  3. Question: You need to keep track of how many objects of a given class exist WITHOUT introducing a non-class member vairable. Which one of the following will allow you to do this?

    A
    Add a member variable that gets incremented in the default constructor and decremented in the destructor

    B
    Add a local variable that gets incremented in each constructor and decremented in the destructor

    C
    Add a static member variable that gets incremented in each constructor and decremented in the destructor

    D
    This cannot be accomplished since the creation of objects is being done dynamically vai "new."

    Note: Not available
    1. Report
  4. Question: What will be the output of the following code
    $var = 10;
    function fn()
    {
    $var = 20;
    return $var;
    }
    fn();
    echo $var;

    A
    10

    B
    20

    C
    Undefined Variable

    D
    Syntax Error

    Note: Not available
    1. Report
  5. Question: What will be the output of the following code? $var = 1 + "-1.3e3"; echo $var;

    A
    -1299

    B
    1

    C
    1-1.3e3

    D
    Error:cannot add an integer and a string

    Note: Not available
    1. Report
  6. Question: To retain the value of a local variable of a function over multiple calls to that function, you must declare that variable as:

    A
    local

    B
    global

    C
    static

    D
    none of these

    Note: Not available
    1. Report
  7. Question: An array has four elements. The elements index are:

    A
    0 1 2 and 3

    B
    1 2 3 and 4

    C
    a b c and d

    D
    a or 0, b or 1, c or 2, and d or 3

    E
    Anything as long as each is different

    Note: Not available
    1. Report
  8. Question: What will be output of the following code?
    class test{
      private $a;
      function set($x){
       $this->a =$x;
      }
      public function get(){
       return $this->a;
      }
    }
    
    $t1 = new test;
    $t1->set(10);
    echo $t1->get();

    A
    0

    B
    10

    C
    Error

    D
    None

    Note: Not available
    1. Report
  9. Question: What is meant by the term variable functions?

    A
    if a variable name has parentheses appended to it, PHP will look for a function with the same name as whatever the variable evaluates to, and will attempt to execute it

    B
    if a variable name has parentheses appended to it, PHP will look for a function with the same name and will attempt to execute it

    C
    There is no such term

    Note: Not available
    1. Report
  10. Question: Which of the following is an invalid mode for opening a file?

    A
    r

    B
    rw

    C
    w

    D
    a+

    E
    b

    Note: Not available
    1. Report
Copyright © 2025. Powered by Intellect Software Ltd