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)- A73% (35)
- B8% (4)
- C15% (7)
- D4% (2)
Community Discussion
No community discussion yet for this question.