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

As it is || operator the second expression is not evaluated and p is always incremented, in the first case to 1.



Your comments will be displayed only after manual approval.