Error on Writing Your First 'For' Loop


#1

Each time I try to run this I get the pop-up message, "Something went wrong, click Close to try again or refresh the page." I've tried closing the page and re-opening it, I've tried refreshing the page and I've tried resetting my code, but no matter what I do, I still get this pop-up which prevents me from moving forward.


#2

Hey @darkbelow13 can you pls show your code?


#3

i am also facing that same error this is my code down below




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

  ?>
</p>



#5

me too have same error


#6

I'm having the same problem. The compiler is auto-refreshing and causing it to error out. How do I get it to stop doing that? I don't want to update the code until I hit the submit button. What's happening now is it errors because of an infinite loop issue and locks the browser. Then I'm not able to submit anything and have to refresh. However, It's taking the cached code, "the infinite error" and reloading it, then popping out the same error... The infinite error error message is causing an infinite error! I'm not able to update the code or anything.


#7

you have forgotten the $ before i.
for increment you can use $i += 10

try

for ($i = 10; $i <= 100; $i += 10){
          echo $i;
      }

#10

solution is -----

<?php
for ($i = 10; $i < 101; $i = $i + 10){
echo $i;
}

  ?>

#11

solution is -----

<?php
for ($i = 10; $i < 101; $i = $i + 10){
echo $i;
}

?>


#12

I had the same error, despite the code being correct. There is definitely something wrong with the compiler. It was indicating a problem on line 15, despite the presence of only 14 lines of code.

To proceed to the next lesson, just copy and paste the code from the hint section. It should help bypass the compiler error and let you move on.