?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$i = 0;
while ((--$i > ++$i) - 1)
{
print $i;
}
?>
<?php
$i = 0;
while ((--$i > ++$i) - 1)
{
print $i;
}
?>
Answer & Solution
Correct Answer:
Option
A
(–$i > ++$i) evaluates to 0 but -1 makes it enters the loop and prints i.
Join the Discussion
Login to post a comment or share your explanation.
Login