mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
4887357269
RFC: https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes * The ending label no longer has to be followed by a semicolon or newline. Any non-label character is fine. * The ending label may be indented. The indentation will be stripped from all lines in the heredoc/nowdoc string. Lexing of heredoc strings performs a scan-ahead to determine the indentation of the ending label, so that the correct amount of indentation can be removed when calculting the semantic values for use by the parser. This makes the implementation quite a bit more complicated than we would like :/
11 lines
354 B
PHP
11 lines
354 B
PHP
--TEST--
|
|
Flexible heredoc syntax error 7: no ending token
|
|
--DESCRIPTION--
|
|
Note: the closing ?> has been deliberately elided.
|
|
--FILE--
|
|
<?php
|
|
|
|
echo <<<END
|
|
|
|
--EXPECTF--
|
|
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) in %s on line %d
|