note 95711 added to language.types.string
| From: | ldrut at osu1 dot php dot net | Date: | Sun, 17 Jan 2010 18:24:33 +0000 |
| Subject: | note 95711 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165054@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 75.132.176.241
----
Manual Page -- http://www.php.net/manual/en/language.types.string.php
Edit -- https://master.php.net/note/edit/95711
Del: integrated -- https://master.php.net/note/delete/95711/integrated
Del: useless -- https://master.php.net/note/delete/95711/useless
Del: bad code -- https://master.php.net/note/delete/95711/bad+code
Del: spam -- https://master.php.net/note/delete/95711/spam
Del: non-english -- https://master.php.net/note/delete/95711/non-english
Del: in docs -- https://master.php.net/note/delete/95711/in+docs
Del: other reasons-- https://master.php.net/note/delete/95711
Reject -- https://master.php.net/note/reject/95711
Search -- https://master.php.net/manage/user-notes.php