Home » PHP » PHP While Loops » Question
  1. What will be the output of the following PHP code ?
    <?php
    $m = 8;
    while (--$m > 0 || ++$m)
    {
    print $m;
    }
    ?>
    1. Error
    2. 76546211111........infinite time
    3. 8
    4. Nothing
    5. None of these
Correct Option: B

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



Your comments will be displayed only after manual approval.