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

The loop never ends as m is always incremented and then decremented.



Your comments will be displayed only after manual approval.