Lesson 6.3. Should work but doesn't


Okay, I'm getting rather annoyed here.
First, take a look at my code:

//Add while loop below
$myLoop = 2;
while ($myLoop < 9) {
echo "

Number: {$myLoop}

$myLoop = $myLoop +2;

In the little window it only shows "Parse error: syntax error, unexpected T_INC, expecting T_VARIABLE or '$' on line 13". But if I make the window full screen, it prints out:
"Number: 2

Number: 4

Number: 6

Number: 8", as it should.

When I try to save and submit it only loads, for like, forever. Then, several minutes later, an error message appears which says "Oops, try again. Please follow the instructions on the Full Preview page to test your code."

What is wrong!?


And yes, I do have all the echo code on the same line, it went crazy when I posted.


I'm not sure whether you still need help, but I altered it slightly and it worked:

    //Add while loop below
    $myLoop = 2;
    while ($myLoop < 9) {
        echo "$myLoop";
        $myLoop = $myLoop + 2;

Hope this helps. I had exactly the same problem, but it turned out I just needed to refresh the page :stuck_out_tongue: . That's probably the actual culprit, not a missed semicolon and space...


Yeah, my code worked, I only had to copy the code, refresh the page, paste the code and then save & submit. Guess it thought I was too slow :wink: