|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-16 21:58 UTC] nospam at 1111-internet dot com
Description: ------------ Heredoc syntax adds one extra line number and thus skews all subsequent script line numbers. Example uses PHP CLI, but also affects PHP as Apache module. Reproduce code: --------------- <?php echo __LINE__, "\n"; $x=<<<XXX 123 XXX; echo __LINE__, "\n"; ?> Expected result: ---------------- 2 6 Actual result: -------------- 2 7 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
Dmitry, check out the patch, plz: Index: Zend/zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.131.2.9 diff -u -p -d -r1.131.2.9 zend_language_scanner.l --- Zend/zend_language_scanner.l 4 Jan 2006 23:53:04 -0000 1.131.2.9 +++ Zend/zend_language_scanner.l 16 Jan 2006 21:09:17 -0000 @@ -1706,7 +1706,6 @@ NEWLINE ("\r"|"\n"|"\r\n") <ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { char *s; - CG(zend_lineno)++; CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0); s = yytext+3; while ((*s == ' ') || (*s == '\t')) {