Parse Errror: unexpected $end (not the usual symptoms)

I’ve been getting the dreaded ‘unexpected $end’ message. I tested my setup with the simple test below and still get it. Here is the test code and some caveats. Does anybody know why I might still be getting this message?


class Skin

public static function Test()
echo <<<EOF
'hello world'



Here are the caveats:

  1. There are no short tags anywhere.
  2. There are no unclosed () or {} anywhere.
  3. There are no missing , or ; anywhere.
  4. There are no spaces before or after the final ?>.

What is the full error message?

The only thing I can guess is that your “EOF;” isn’t the first thing on its line. In your code above there are no indents, but I hope that’s just a code-paste thing and it’s indented appropriately. However, make EOF; the very beginning thing on its line.

Couple of notes to make - EOF means End Of File. You can use any word you wish there, so EOF (whilst conventional in tutorials) isn’t a necessary thing to use. Also you don’t need those quotes there either, unless they’re there for a reason.

I tested it and didn’t get any errors.

This was it. My code was, in fact, indented, including the ending EOF. =/

Thanks. =)