ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0)
{   
    $i++; print $i; print "hello";
}
?>

Answer & Solution
Correct Answer: Option A
i is decremented in the first while execution and then continuously incremented back.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.