Exercise 4 of 7 write your own for loop continues to fail


Completing PHP is impossible because "create for loop from scratch" crashes for some on for seen reason. I'm not allowed to type in my code. The code displays unexpected character in line 9 expected ")" even if I close my for loop I receive a pop up error message stating that something went wrong and I should refresh my browser. When I do the exercise crashes again. Is there some way to correct this?


Hi scriptwhiz83717,

It is going to be easier to help if you show us your code.


Same for me - it doesnt matter what you input it just locks up and wont continue -



Are you able to post your code?


I keep getting same error message even before completing my code. Please see attached image for the error message. I'm skipping it to the next lesson though.
Thank you.


That message means that your code contains an infinite loop.


Yes, I made a mistake initially on the code, but corrected it. Meanwhile, the error won't go off.
Here's the code I entered before
for ($i = 10; $i < 101; $i + 10)
echo $i;
which I believe is an infinite loop, but corrected to this and still getting same error message.

for ($i = 10; $i < 101; $i = $i + 10)
echo $i;


Your second example works for me. Try reloading/refreshing the web page If that doesn't work could you copy/paste all of your code so I can try it?


Here is all the code:

    <title>Solo For Loop!</title>
      // Write your for loop below!
      for($i = 10; $i < 101; $i = $i + 10) 

The problem now is that the error code won't let me work on the page again. Even having corrected it, I can't save.


That bit there seems to be missing from the code you posted.

I can't reproduce what you are seeing, even when I purposely create an infinite loop.

Are you able to try a different web browser just to get past this exercise?


I skipped to next tutorial, having run the code on notepad++ and got accurate result. I'm now doing the while loop. The intro seem complex, so I'm sleeping off to relax my head and continue while awake. 😄

Thanks Albion.