Closed
Description
Description
The following code:
<?php
class A {
public $class = A::class;
}
var_dump((new A)-> /* a meaningful comment */ class);
Resulted in this output:
Parse error: syntax error, unexpected token "class", expecting identifier or variable or "{" or "$" in /in/8t7hs on line 7
But I expected this output instead:
string(1) "A"
Looks like we're popping out of ST_LOOKING_FOR_PROPERTY when encountering a comment, leaving us in a bad state.
PHP Version
master (all versions of PHP 8)
Operating System
No response