tolerant-php-parser
tolerant-php-parser copied to clipboard
Expected ";" when you have a "use Object;" statement.
From @SilbinaryWolf on November 3, 2017 0:42
Silverstripe 3.6 uses the class name "Object" and runs fine in PHP 7.1.
I'm aware Object is a soft keyword and could stop working in future PHP versions, but until then, can this please be fixed.
Example code that gets an error: https://github.com/SilbinaryWolf/silverstripe-phpstan/blob/master/src/MethodClassReflectionExtension.php#L19
Test repo, should be able to just composer install and test with the language server:
https://github.com/SilbinaryWolf/silverstripe-phpstan-testproject
Copied from original issue: felixfbecker/php-language-server#516
Also to be clear this is not allowed in PHP 7.2 and further according to https://wiki.php.net/rfc/object-typehint.
If it's still possible and fairly simple to support this kind of statement for PHP 7.1 and lower, that'd be fantastic.