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 is the result of the following expression? 5+2*4+6

    A
    70

    B
    19

    C
    34

    D
    21

    Note: Not available
    1. Report
  9. Question: Which of the following statements is not true with regard to abstract classes in php5?

    A
    Abstract classes are introduced in PHP5

    B
    A class with a single abstract method must be declared abstract

    C
    Abstract class can nontain non abstract methods

    D
    Abstract method must have method definition and can have optional empty braces following it

    Note: Not available
    1. Report
  10. Question: The following php variables are declared:
    <?php
    $company = 'ABS Ltd';
    $$company = ',Sydney';
    ?>
    Which of the following is not a correct way of printing 'ABS Ltd, Sydney'?

    A
    echo "$company $$company";

    B
    echo "$company ${$company}";

    C
    echo "$company ${'ABS Led'}";

    D
    echo "$company {$$company}";

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