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

The first condition itself fails thus the loop exits.



Your comments will be displayed only after manual approval.