Edit report at http://bugs.php.net/bug.php?id=53672&edit=1
ID: 53672 Updated by: [email protected] Reported by: dicugeorge1987 at yahoo dot com Summary: Parser inconsistency for nowdoc/Heredoc vs. "normal" variable assignment at EOF -Status: Open +Status: Bogus Type: Bug Package: Scripting Engine problem PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected. The documentation states "The closing delimiter (possibly followed by a semicolon) must also be followed by a newline." http://docs.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Previous Comments: ------------------------------------------------------------------------ [2011-01-06 16:46:51] flavius dot as at gmail dot com Note that this will work though: <?php $foo = 'bar'; ------------------------------------------------------------------------ [2011-01-06 16:36:48] dicugeorge1987 at yahoo dot com Description: ------------ Nowdocs and heredocs should also be LALR-reduced when EOF follows after T_END_HEREDOC, not only EOL Test script: --------------- <?php $bar = <<<'EOD' $foo is a variable EOD; Expected result: ---------------- $foo is a variable Actual result: -------------- Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_END_HEREDOC or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in J:\webdev\apache\htdocs\salut2.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53672&edit=1
