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

(–$t > ++$t) evaluates to 0 but -1 makes it enters the loop and prints t.



Your comments will be displayed only after manual approval.