New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is_subclass_of(string, string) generates invalid prediction #3979
Comments
@vovmog After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-21: Call to an undefined method object::toArray().
+No errors |
It seems this was also fixed by phpstan/phpstan-src#1039. |
Fixed: phpstan/phpstan-src@73f14db |
The first example still reports an error. |
This gives more insight into the types involved: https://phpstan.org/r/4399bb2a-cf2b-4038-9716-97cac1e647d4 |
This can be simplified to https://phpstan.org/r/2b8bb6fd-da7d-4f2c-9318-246cf0ce29a1 is_subclass_of(class-string, string) is always true for PHPStan I would have expected to find a DynamicReturnTypeExtension, but all I found is |
would ge great if this count be fixed |
Bug report
Erroneus report:
Result of && is always false
Clearly that is not correct as demonstrated by the two calls below.
Code snippet that reproduces the problem
https://phpstan.org/r/99bd746d-80c2-4eb1-8506-2840c6fd5089
Expected output
No errors.
The text was updated successfully, but these errors were encountered: