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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC