nerdexam
Zend

200-530 · Question #499

Consider the following PHP script: <?php function b($a = 4) { $a = $a / 2; return $a; } $a = 10; b($a); echo $a; ?> What will be the output?

The correct answer is A. 10. See the full explanation below for the reasoning.

Question

Consider the following PHP script: <?php function b($a = 4) { $a = $a / 2; return $a; } $a = 10; b($a); echo $a; ?> What will be the output?

Options

  • A10
  • BThe script will throw an error message.
  • C5
  • D2

How the community answered

(48 responses)
  • A
    73% (35)
  • B
    8% (4)
  • C
    15% (7)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice