#36037 [Opn->Asn]: heredoc adds extra line number

From: Date: Mon, 16 Jan 2006 21:10:31 +0000
Subject: #36037 [Opn->Asn]: heredoc adds extra line number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92018@lists.php.net to get a copy of this message
ID: 36037 Updated by: tony2001@php.net Reported By: nospam at 1111-internet dot com -Status: Open +Status: Assigned -Bug Type: Unknown/Other Function +Bug Type: Scripting Engine problem -Operating System: FreeBSD 5.4 +Operating System: * -PHP Version: 4.4.2 +PHP Version: 4.4.2, 5.1.3-CVS -Assigned To: +Assigned To: dmitry New Comment: 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')) { Previous Comments: ------------------------------------------------------------------------ [2006-01-16 21:58:28] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36037&edit=1

« previous php.bugs (#92018) next »