A

Admin • 828.03K Points
Coach

Q. What will be the output of the following PHP code ?

Code:
<?php
$m = 8;
while (--$m > 0 || ++$m)
{
print $m;
}
?>
  • (A) Error
  • (B) 76546211111........infinite time
  • (C) 8
  • (D) Nothing
  • Correct Answer - Option(B)
  • Views: 9
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin
As it is || operator the second expression is not evaluated till m becomes 1 then it goes into a loop.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.