214 quizzes found.

Which statement will return the third parameter passed to a function?

  1. $argv[3];
  2. $argv[2];
  3. func_get_args(3);
  4. func_get_arg(2);
  5. func_get_arg(3);

Choose 1 answers

What is the output of the following code?

function oranges(&$oranges = 17){$oranges .= 1;}$apples = 5;oranges($apples);echo $apples++;
  1. 16
  2. 51
  3. 15
  4. 6
  5. 5

Choose 1 answers

What is the output of the following code?

function pears(Array $pears){if (count($pears) > 0){echo array_pop($pears);pears($pears);}}$fruit = array("Anjo", "Bartlet");pears($fruit);
  1. Bartlet
  2. Anjo
  3. BartletAnjo
  4. AnjoBartlet
  5. None / There is an Error

Choose 1 answers

http://php.net/manual/en/function.array-pop.php

In PHP5 objects are passed by reference to a function when (Select the answer that is the most correct):

  1. Always; objects are passed by reference in PHP5
  2. When the calling code preceeds the variable name with a &
  3. Never; objects are cloned when passed to a function
  4. When the function paramater listing preceeds the variable name with a &

Choose 1 answers

What is the output of the following code?

<?phpfunction byReference(&$variable = 5){ echo ++$variable;}byReference();?>
  1. No output or error. Variables can not be optional and passed by reference.
  2. 5
  3. 6

Choose 1 answers