Sail E0 Webinar

MCQs

Total Questions : 121 | Page 7 of 13 pages
Question 61. What will be the output of the following PHP code ?$a = 10;$b = 4;$c = fun(10,4);function fun($a,$b) {$b = 3;return $a - $b + $b - $a;}echo $a;echo $b;echo $c;
  1.    4100
  2.    410
  3.    104
  4.    1400
 Discuss Question
Answer: Option D. -> 1400
Question 62. What will be the output of the following PHP code ?$a = "$winner";$b = "/$looser";echo $a,$b;
  1.    /
  2.    $looser
  3.    /$looser
  4.    $winner/$looser
 Discuss Question
Answer: Option A. -> /
Question 63. What will be the output of the following PHP code ?$a = "$winner";$b = "$looser";echo $a, $b;
  1.    \
  2.    $winner$looser
  3.    $looser
  4.    $looser
 Discuss Question
Answer: Option C. -> $looser
Question 64. What will be the output of the following PHP code ?$x = 5;$y = 10;function fun() {$y = $GLOBALS['x'] + $GLOBALS['y'];}fun();echo $y;
  1.    5
  2.    Error
  3.    10
  4.    15
 Discuss Question
Answer: Option C. -> 10
Question 65. What will be the output of the following PHP code ?$x = 5;$y = 10;function fun() {$GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];}fun();echo $y;
  1.    Error
  2.    15
  3.    5
  4.    10
 Discuss Question
Answer: Option B. -> 15
Question 66. What will be the output of the following PHP code ?function fun() {$x = 0;echo $x;$x++;}fun();fun();fun();
  1.    000
  2.    012
  3.    111
  4.    123
 Discuss Question
Answer: Option A. -> 000
Question 67. What will be the output of the following PHP code ?function fun() {static $x = 0;echo $x;$x++;}fun();fun();fun();
  1.    111
  2.    123
  3.    012
  4.    Error
 Discuss Question
Answer: Option C. -> 012
Question 68. What will be the output of the following PHP code ?static $x = 0;function fun() {echo $x;$x++;}fun();fun();fun();
  1.    Error
  2.    Nothing
  3.    012
  4.    123
 Discuss Question
Answer: Option B. -> Nothing
Question 69. What will be the output of the following PHP code ?$x = 0;function fun() {echo $GLOBALS['x'];$x++;}fun();fun();fun();
  1.    000
  2.    012
  3.    Error
  4.    Nothing
 Discuss Question
Answer: Option A. -> 000
Question 70. What will be the output of the following PHP code ?$x=0; function fun() {echo $GLOBALS['x'];$GLOBALS['x']++;}fun();fun();fun();
  1.    Error
  2.    012
  3.    000
  4.    123
 Discuss Question
Answer: Option B. -> 012

Latest Videos

Latest Test Papers