php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76991 Incorrect tokenization of multiple invalid flexible heredoc strings
Submitted: 2018-10-10 12:07 UTC Modified: -
From: nikic@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.3.0RC2 OS:
Private report: No CVE-ID: None
 [2018-10-10 12:07 UTC] 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)
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-10 13:01 UTC] nikic@php.net
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
 [2018-10-10 13:01 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Dec 13 22:01:26 2018 UTC