Bug #76608 [Opn->Ver]: Heredoc end label should not require an additional trailing character
| From: | cmb@php.net | Date: | Wed, 11 Jul 2018 14:55:06 +0000 |
| Subject: | Bug #76608 [Opn->Ver]: Heredoc end label should not require an additional trailing character | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216275@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76608&edit=1
ID: 76608
Updated by: cmb@php.net
Reported by: mattacosta at gmail dot com
Summary: Heredoc end label should not require an additional
trailing character
-Status: Open
+Status: Verified
Type: Bug
Package: Scripting Engine problem
-PHP Version: 7.3.0alpha3
+PHP Version: 7.2.7
Block user comment: N
Private report: N
New Comment:
This does not appear particularly related to PHP 7.3, see
<https://3v4l.org/CeumU>.
Previous Comments:
------------------------------------------------------------------------
[2018-07-11 01:01:22] mattacosta at gmail dot com
Description:
------------
If a perfectly valid heredoc is not followed by an additional character, the reported error states
that an end label was expected, even though it was present.
This means that instead of removing the requirement for a trailing newline, it was in fact replaced
by a requirement for any trailing character.
Test script:
---------------
// No trailing line.
echo <<<LABEL
hello world
LABEL
Expected result:
----------------
Parse error: syntax error, unexpected end of file, expecting ',' or ';'
Actual result:
--------------
Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or heredoc end
(T_END_HEREDOC) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76608&edit=1