If PHP code contains attributes that relies on the parser understanding there basic syntax it can break parsing of the file.
class MyClass
{
public function myFunc(#[AnAttribute(['one', 'two'])] string $input): mixed {}
}
As a stop gab these can be treated similar to block comments starting at #[ and ending with the corresponding ], but be aware that they can both span multiple lines and have nested square brackets.
At a later point it may be preferable to be able to parse attributes as they might contain IDE relevant info.
What happened?
If PHP code contains attributes that relies on the parser understanding there basic syntax it can break parsing of the file.
As a stop gab these can be treated similar to block comments starting at
#[
and ending with the corresponding]
, but be aware that they can both span multiple lines and have nested square brackets.At a later point it may be preferable to be able to parse attributes as they might contain IDE relevant info.
Version
Other
Operating system
Linux
Steps to reproduce
Relevant log output
No response