National_Instruments
200-500 · Question #145
200-500 Question #145: Real Exam Question with Answer & Explanation
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 script? 1 <?php 2 function ratio ($x1 = 10, $x2) 3 { 4 if (isset ($x2)) { 5 return $x2 / $x1; 6 } 7 } 9 echo ratio (0); 10 ?>
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
Community Discussion
No community discussion yet for this question.