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

Unexpected syntax error with multi-level scope resolution #2175

Open
plafrance opened this issue Apr 30, 2023 · 1 comment
Open

Unexpected syntax error with multi-level scope resolution #2175

plafrance opened this issue Apr 30, 2023 · 1 comment

Comments

@plafrance
Copy link

@prettier/plugin-php v0.19.4
Playground link

Input:

<?php
enum Bar: int {
    case test = 42;
}

class Foo
{
	const BarInFoo = Bar::test;
}

print Foo::BarInFoo::class; //Prints Bar
?>

Output:

Parse Error : syntax error, unexpected '::' (T_DOUBLE_COLON) on line 11

   9 | }
  10 |
> 11 | print Foo::BarInFoo::class; //Prints Bar
     |                   ^
  12 | ?>

Expected behavior:

No error reported.

@czosel
Copy link
Collaborator

czosel commented Apr 30, 2023

Hi @plafrance, thanks for the bug report. This seems to be a parser problem, I created an issue for it: glayzzle/php-parser#1093

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

No branches or pull requests

3 participants