tolerant-php-parser
tolerant-php-parser copied to clipboard
match is a valid method name
match
can still be used as a method name and as a class constant name in PHP 8.0, but tolerant-php-parser gives an error.
$parser = new Microsoft\PhpParser\Parser;
$ast = $parser->parseSourceFile('<?php class C { function match() {} }');
var_dump(Microsoft\PhpParser\DiagnosticsProvider::getDiagnostics($ast));
array(7) {
[0]=>
object(Microsoft\PhpParser\Diagnostic)#480 (4) {
["kind"]=>
int(0)
["message"]=>
string(16) "'Name' expected."
["start"]=>
int(24)
["length"]=>
int(0)
}
...