National_Instruments
200-500 · Question #145
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 ?>
Sign in or unlock 200-500 to reveal the answer and full explanation for question #145. The question stem and answer options stay visible for context.
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
Unlock 200-500 to see the answer
You've previewed enough free 200-500 questions. Unlock 200-500 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.