tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Expected ";" when you have a "use Object;" statement.

Open felixfbecker opened this issue 8 years ago • 2 comments
trafficstars

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

felixfbecker avatar Nov 03 '17 00:11 felixfbecker

Also to be clear this is not allowed in PHP 7.2 and further according to https://wiki.php.net/rfc/object-typehint.

nesl247 avatar Nov 17 '17 15:11 nesl247

If it's still possible and fairly simple to support this kind of statement for PHP 7.1 and lower, that'd be fantastic.

silbinarywolf avatar Nov 18 '17 02:11 silbinarywolf