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

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



Your comments will be displayed only after manual approval.