Free 200-550 Exam Braindumps (page: 24)

Page 23 of 56

What is the output of the following code?
function fibonacci (&$x1 = 0, &$x2 = 1)
{
$result = $x1 + $x2;
$x1 = $x2;
$x2 = $result;
return $result;
}
for ($i = 0; $i < 10; $i++) {
echo fibonacci() . ', ';
}

  1. An error
  2. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,
  4. Nothing

Answer(s): B



What is the output of the following code?
function ratio ($x1 = 10, $x2)
{
if (isset ($x2)) {
return $x2 / $x1;
}
}
echo ratio (0);

  1. 0
  2. An integer overflow error
  3. A warning, because $x1 is not set
  4. A warning, because $x2 is not set
  5. A floating-point overflow error
  6. Nothing

Answer(s): D



Which of the following is NOT a valid function declaration?

  1. function x ($x1 = array())
  2. function x (A $x1)
  3. function x (A $x1 = null)
  4. function x ($x1 = $x2)

Answer(s): D



CORRECT TEXT
What is the output of the following code?
function increment (&$val)
{
return $val + 1;
}
$a = 1;
echo increment ($a);
echo increment ($a);

  1. 22

Answer(s): A






Post your Comments and Discuss Zend 200-550 exam with other Community members:

200-550 Discussions & Posts