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

As it is && operator it is being incremented and decremented continuously.



Your comments will be displayed only after manual approval.