Skip to content

Enum is treated as a reserved word, even before PHP 8.1 #896

Description

@czosel

Input: class Enum {}
Output: syntax error, unexpected 'Enum' (T_ENUM), expecting T_STRING

The official PHP parser seems to be able to handle this example even after PHP 8.1 - if that turns out to be too difficult to fix here, maybe should consider adding the keyword only for PHP >= 8.1?

Also see #895 for a failing test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions