ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.