Skip to content

Fail to parse a class named "Enum" #35

@qMBQx8GH

Description

@qMBQx8GH

PHP Version

8.0 8.1

Code Example

class Enum{}

Actual Behavior

2023/12/15 09:35:40 syntax error: unexpected T_ENUM, expecting T_STRING at line 1

Expected Behavior

[max@max ~/src/php-parser-test]$ cat test.php
<?php
class Enum {}
[max@max ~/src/php-parser-test]$ php8.0 -l test.php
No syntax errors detected in test.php
[max@max ~/src/php-parser-test]$ php8.1 -l test.php
No syntax errors detected in test.php

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