Skip to content

Wrong token type for backslash in use function #1547

Closed
@michalbundyra

Description

@michalbundyra

In case:

use function \array_keys

backslash is tokenized as T_STRING.

In case:

use function \MyNamespace\myFunction;

first backslash is tokenzed as T_STRING and the second one as T_NS_SEPARATOR.


If we import class:

use \DateTime;

or global constant:

use const \PHP_VERSION_ID;

or constant from other namespace:

use const \MyNamespace\MY_CONST;

all backslashes are tokenized as T_NS_SEPARATOR.


I would expect then the same behaviour for importing functions, so all backlashes should be there always tokenized as T_NS_SEPARATOR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions