This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by michelbaas
over 10 years

3/7: Parse error: syntax error, unexpected ')', expecting ';' on line 8

Same here, in full screen the output is correct. The small screen inside the editor-environment is giving me a syntax error:

Parse error: syntax error, unexpected ‘)’, expecting ‘;’ on line 8

  <?php
  for ($lp = 10; $lp <= 100; $lp = $lp + 10)
  {
      echo "<p>$lp</p>";
  }
  
  ?>

When I hit the Save & Submit Code button it won’t do much, no feedback, no red or green. While it’s clearly the right code.

So it must be some bug in the background, but we have problems completing this lesson and so the course. What’s the problem?

Answer 52c873fa282ae33ec5003039

0 votes

Permalink

Okay, so I got out of the course got back in, my list was being output inside the small preview window, hit the Save & Submit Code button, gave me something on the bracket, so move the first one after the ( ), and then it was accepted.

points
Submitted by michelbaas
over 10 years

Answer 52c87516548c35e1b8003427

0 votes

Permalink

Oh yeah, I pretty much just started with the lesson, maybe 30 seconds in, now I have that again with 4/7 and I got this message:

The program took too long to finish. Check your code for infinite loops and try again.

points
Submitted by michelbaas
over 10 years

Answer 52c9bb707c82ca6a4400671b

0 votes

Permalink

There seems to be an issue with the compiler (not sure if that’s the right terminology). Try constructing the code without the “for” statement. Add the “for” at the very end, then hit submit…. That worked for me

e.g. Step 1: <?php // Write your for loop below! ($p=10;$p<=100;$p=$p+10) { echo "<p>$p</p>"; } ?>
Step 2: <?php // Write your for loop below! for ($p=10;$p<=100;$p=$p+10) { echo "<p>$p</p>"; } ?>

points
Submitted by afuze
over 10 years