Description:
------------
If a heredoc/nowdoc identifier is immediately followed by a digit,
it is mistankenly recognized as closing identifier. While the
documentation on the relaxed heredoc/nowdoc is sparse yet, the
RFC[1] claims:
| The implementation I am proposing avoids this problem by
| checking to see if a continuation of the found marker exists, and
| if so, then if it forms a valid identifier. This means that the
| terminating marker string will only be considered as such if it is
| matched exactly as a standalone, valid symbol (that is also found
| at the start of the line).
Since digits are allowed in identifiers, I think the current behavior
is a bug.
[1] <https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes>
Test script:
---------------
<?php
echo <<<FOO
FOO4
FOO;
Expected result:
----------------
FOO4
Actual result:
--------------
Parse error: syntax error, unexpected '4' (T_LNUMBER), expecting ';' or ',' in %d on line 3