|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-08-10 15:11 UTC] git@php.net
[2021-08-10 15:11 UTC] git@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ The "&" token is parsed as T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG when space and then variable follows, but it's parsed to T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG when newline and then variable follows. Test script: --------------- <?php $tokens = token_get_all('<?php $x & $x; $x & $baz; '); var_dump($tokens[3][1]); var_dump(token_name($tokens[3][0])); var_dump($tokens[10][1]); var_dump(token_name($tokens[10][0])); Expected result: ---------------- string(1) "&" string(37) "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG" string(1) "&" string(37) "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG" Actual result: -------------- string(1) "&" string(37) "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG" string(1) "&" string(41) "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG"