?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>
Answer & Solution
Correct Answer:
Option
D
The value of x is decremented thus making it an infinite loop.
Join the Discussion
Login to post a comment or share your explanation.
Login