-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
Caching of method result results in false positives #3203
Comments
To reword this bug report - when an object is passed somewhere, it should invalidate all it remembers about it in the current scope: |
@marcelthole PHPStan now reports different result with your code snippet: @@ @@
+32: Call to function assert() with false will always evaluate to false.
32: Strict comparison using !== between null and null will always evaluate to false. Full report
|
@marcelthole After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-32: Strict comparison using !== between null and null will always evaluate to false.
+No errors |
Fixed: phpstan/phpstan-src@f92b95e |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Hey,
it seems that the return type of a method is cached, even if the reference of the object has changed in a other service. Therefore a method can be called twice and the return type could be changed by a other service
Code snippet that reproduces the problem
This works fine:
https://phpstan.org/r/d7904a4a-44a6-4bb2-a889-cc1dde0732c7
This produce an error:
https://phpstan.org/r/63d35fc8-acbd-4809-b4fb-c1c3556b6f85
Expected output
I expect, that any change of a object results in a new check of the method return values
The text was updated successfully, but these errors were encountered: