note 105369 added to language.types.string
| From: | sgbeal at googlemail dot com | Date: | Fri, 12 Aug 2011 11:44:13 +0000 |
| Subject: | note 105369 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182441@lists.php.net to get a copy of this message | ||
The docs say: "Heredoc text behaves just like a double-quoted string, without the double
quotes" but there is a notable hidden exception to that rule: the final newline in the string
(the one before closing heredoc token) is elided. i.e. if you have:
$foo = <<<EOF
a
b
c
EOF;
the result is equivalent to "a\nb\nc", NOT "a\nb\nc\n" like the docs imply.
----
Server IP: 69.147.83.197
Probable Submitter: 194.246.122.11
----
Manual Page -- http://www.php.net/manual/en/language.types.string.php
Edit -- https://master.php.net/note/edit/105369
Del: integrated -- https://master.php.net/note/delete/105369/integrated
Del: useless -- https://master.php.net/note/delete/105369/useless
Del: bad code -- https://master.php.net/note/delete/105369/bad+code
Del: spam -- https://master.php.net/note/delete/105369/spam
Del: non-english -- https://master.php.net/note/delete/105369/non-english
Del: in docs -- https://master.php.net/note/delete/105369/in+docs
Del: other reasons-- https://master.php.net/note/delete/105369
Reject -- https://master.php.net/note/reject/105369
Search -- https://master.php.net/manage/user-notes.php