0
Whats wrong with "Take a short cut" in php
$x = 0; while($x<=7) { $x++; } echo $x;
3 Respuestas
+ 1
It outputs 8 after the loop.
0
how? please explain
0
In the last iteration of the while loop, the comparison checks to see if $x is less than or equal to 7. $x is 7 and the loop is entered and $x is incremented to 8. Then the comparison is checked again, but 8 is greater than 7, so the while loop is exited and $x is echoed outputting 8