note 105369 deleted from language.types.string by cmb
| From: | cmb@php.net | Date: | Sun, 04 Aug 2019 09:12:18 +0000 |
| Subject: | note 105369 deleted from language.types.string by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211800@lists.php.net to get a copy of this message | ||
Note Submitter: sgbeal at googlemail dot com
----
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.