Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1: Keywords as enum cases #807

Closed
arokettu opened this issue Sep 14, 2021 · 0 comments
Closed

PHP 8.1: Keywords as enum cases #807

arokettu opened this issue Sep 14, 2021 · 0 comments

Comments

@arokettu
Copy link

PHP Fatal error:  Uncaught PhpParser\Error: Syntax error, unexpected T_ARRAY, expecting T_STRING on line 7 in lib/PhpParser/ParserAbstract.php:318

for this code:

<?php

require 'vendor/autoload.php';

enum Types
{
    case Array;
    case Object;
}

$parser = (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7);

$parser->parse(file_get_contents(__FILE__));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant