|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-31 00:21 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: Scripting Engine problem
[2018-03-15 18:17 UTC] lunakid at gmail dot com
[2018-04-13 20:03 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2018-04-13 20:03 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Comma should be added to the allowable line suffixes for HEREDOC keywords. The use of HEREDOC in an array becomes very ungainly because the keyword can not be terminated followed by a comma. Currently the addition of a comma renders the scripting engine unable to recognize the keyword as being the terminator for the HEREDOC string and the rest of the script is absorbed resulting in an "syntax error, unexpected $end" E_PARSE_ERROR. Reproduce code: --------------- <?php $foo = array( 'blah' => <<<SQL SELECT * FROM test WHERE RAND() SQL, 'foo' => 'bar', 'baz' => 'blat' ); print_r($foo); ?> Expected result: ---------------- The comma should not prevent the HEREDOC string from being terminated, and should be a valid suffix, just like semi-colon is. Actual result: -------------- Parse error: syntax error, unexpected $end in test.php on line 16