php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76538 token_get_all with TOKEN_PARSE flag fails to recognise close tag with newline
Submitted: 2018-06-27 20:49 UTC Modified: -
From: nathanielzimmermann at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.3.0alpha2 OS: MacOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nathanielzimmermann at gmail dot com
New email:
PHP Version: OS:

 

 [2018-06-27 20:49 UTC] nathanielzimmermann at gmail dot com
Description:
------------
token_get_all with the TOKEN_PARSE flag fails to recognise the T_CLOSE_TAG token if the close tag has a newline afterwards

Test script:
---------------
var_dump(token_get_all("<?php echo 1 ?>\n", TOKEN_PARSE)[5]);

Expected result:
----------------
array(3) {
  [0]=>
  int(381)
  [1]=>
  string(3) "?>
"
  [2]=>
  int(1)
}

Actual result:
--------------
string(3) "?>
"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-27 21:06 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=9b02ee0bba86becc951b65bb6d3527cf3ba7265e
Log: Fixed bug #76538
 [2018-06-27 21:06 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 18 06:01:23 2021 UTC