Skip to content

T_AMPERSAND token #44

Description

@staabm

in sebastianbergmann/php-code-coverage#1125 we can see the token-names for tokenizing the file https://github.com/sebastianbergmann/php-code-coverage/blob/555cd5e6f887648198b96ed89c6880d6f61a0733/tests/_files/source_with_class_and_anonymous_function.php

changed

-        <token name="T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG">&amp;</token>
+        <token name="T_AMPERSAND">&amp;</token>

with the 2.0 release.

T_AMPERSAND was a token type in PHP4.x and it only existed in theseer/tokenizer, because it was hard-coded in

'&' => 'T_AMPERSAND',

since PHP5+ the builtin token names are
T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
and/or T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG

https://3v4l.org/tU46U#veol

it looks like with 2.0.x we are now using T_AMPERSAND more often as we did with the 1.x counterpart.


I am not sure yet what todo about it, but wanted to leave it here so we can discuss the possible impact and/or a fix

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions