?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
for(++$i; ++$i; ++$i)
{
print $i;
if ($i == 4)
break;
}
?>
<?php
for(++$i; ++$i; ++$i)
{
print $i;
if ($i == 4)
break;
}
?>
Answer & Solution
Correct Answer:
Option
A
The order of execution is initialization, check, increment/decrement, check, increment/decrement, check, increment/decrement….so on.
Join the Discussion
Login to post a comment or share your explanation.
Login