note 95711 deleted from language.types.string by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 Jan 2010 19:18:20 +0000 |
| Subject: | note 95711 deleted from language.types.string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165057@lists.php.net to get a copy of this message | ||
Note Submitter: ldrut
----
Salil Kothadia on 15-Oct-08 is right about the behavior but not the cause.
I don't see it in the docs, but the closing line of a HEREDOC must be identifier, optional
semicolon, AND a newline.
If the HEREDOC ends the file (EOF immediately follows the closing semicolon of a HEREDOC without an
intervening newline), it will give a "Parse error: syntax error, unexpected $end" error.
Watch for online editors that automatically strip blank lines from the end of files making the error
a bit sneaky.
The easiest solution is just to put a comment on a line following the close of the HEREDOC.