plugin-php
plugin-php copied to clipboard
Unexpected syntax error with multi-level scope resolution
@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.
Hi @plafrance, thanks for the bug report. This seems to be a parser problem, I created an issue for it: https://github.com/glayzzle/php-parser/issues/1093