Zend
200-550 · Question #67
What is the output of the following code? function ratio ($x1 = 10, $x2) { if (isset ($x2)) { return $x2 / $x1; } } echo ratio (0);
The correct answer is D. A warning, because $x2 is not set. See the full explanation below for the reasoning.
Question
What is the output of the following code? function ratio ($x1 = 10, $x2) { if (isset ($x2)) { return $x2 / $x1; } } echo ratio (0);
Options
- A0
- BAn integer overflow error
- CA warning, because $x1 is not set
- DA warning, because $x2 is not set
- EA floating-point overflow error
- FNothing
How the community answered
(36 responses)- A3% (1)
- C11% (4)
- D81% (29)
- E6% (2)
Community Discussion
No community discussion yet for this question.