php-language-server
php-language-server copied to clipboard
"Integer" looks like a reserved keyword
Following code produces errors while it shouldn't:
class Integer {
public function a(): Integer // 'ReturnType' expected // '{' expected
{ // '}' expected
return $this;
}
}
I am currently traveling and can't check this yet.
But do try public function a(): self
instead of Integer
.
Does the problem also happen if the class name is something else, not Integer
?
Best!
self
produces no error, but that's still an issue, because it's a false error report for a valid PHP code.
I haven't tested other names like that yet.
Same as https://github.com/zobo/php-language-server/issues/81 and https://github.com/microsoft/tolerant-php-parser/issues/413