Why am I not going forward?It seems right


#1

Following are the instruction:
Write a for loop that counts up by 10, all the way to 100 (e.g. 10, 20, 30...). Inside the for loop, echo the current value of $i, just like in the examples above.

Well this is my code:

<?php
// Write your for loop below!
for($i = 10; $i<=100; $i = $i + 10){
echo $i;
}
?>

In the default small output window the output is:
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' on line 9
line 9 for($i = 10; $i<=100; $i = $i + 10){

But on the bigger one:
102030405060708090100

According to http://phptester.net/ output is 102030405060708090100


#2

If we were to type our code in a local editor then copy and paste it into the live editor, there would be no problem. The code is complete. But typing into the live editor we have to be very quick on the keys owing to auto-run. It's a pain, we know, but it's also a boon, so there is no reason to remove it. We may wish to disable it, though, and that we can do with a single introduced (and therefore easily removable) syntax error.

Any error will do, early in the code is best. Just plop it in, and remove it when ready to run.

Sometimes there is no issue with our 'fete de complete' when we get a chance to complete it.