If/Else hangs


The training seems to have a bug. Every time I submit a code, the gear icon starts spinning without any feedback. I've been waiting for 10 minutes and more now.
Also, the terminal displays the following error message: "Parse error: syntax error, unexpected $end on line 19" What's even more confusing, because there's no line 19 in my code:

        $items = 3;
        if($items > 5) {
          echo "You get a 10% discount!";
        else {
          echo "You get a 5% discount!";

Any idea?



try this

  • cut the whole code
  • refresh your browser
  • paste your code
  • run it


Did that already. In fact, the first time I encountered this issue was yesterday, in a different browser. I thought it could be temporarily, but it wasn't.

I was able to complete the whole Java training as well as some parts of PHP already. But right now I'm stuck because of a bug.

update: Well, tried it once again.. I passed this step now.


glad to hear that :slight_smile:


Thanks for your help!


You need to use brackets { } for else statements, sadly php tutorial is veryyy buggy.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.