Bug #76991 [Opn->Csd]: Incorrect tokenization of multiple invalid flexible heredoc strings

From: Date: Wed, 10 Oct 2018 13:01:08 +0000
Subject: Bug #76991 [Opn->Csd]: Incorrect tokenization of multiple invalid flexible heredoc strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217501@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76991&edit=1 ID: 76991 Updated by: nikic@php.net Reported by: nikic@php.net Summary: Incorrect tokenization of multiple invalid flexible heredoc strings -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 7.3.0RC2 Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=01948f20b8ae8eed252177f63bf2c9c11a8f1b94 Log: Fixed bug #76991 Previous Comments: ------------------------------------------------------------------------ [2018-10-10 12:07:19] nikic@php.net Description: ------------ The end label for the second heredoc string is cut off here, with the remainder becoming a T_STRING. Test script: --------------- <?php $code = <<<'CODE' <?php <<<TEST $a TEST; <<<END $a END; CODE; var_dump(token_get_all($code)); Expected result: ---------------- [11]=> array(3) { [0]=> int(384) [1]=> string(3) " END" [2]=> int(9) } Actual result: -------------- [11]=> array(3) { [0]=> int(384) [1]=> string(3) " EN" [2]=> int(9) } [12]=> array(3) { [0]=> int(319) [1]=> string(1) "D" [2]=> int(9) } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76991&edit=1

« previous php.bugs (#217501) next »