-
-
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
PHPStan thinks static variable can be float #1870
Comments
It's because any |
@ondrejmirtes I see. So basically we assume |
I'm currently rewriting NodeScopeResolver so the tracking might be worth revisiting :) |
|
And coincidentally, this is correct, |
@ondrejmirtes PHPStan now reports different result with your code snippet: @@ @@
-7: Function returnsInt() should return int but returns float|int.
+No errors |
@iluuu1994 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-6: Function returnsInt() should return int but returns float|int.
+No errors |
Nice 😁 Thanks @ondrejmirtes! |
I love this bot :) You're welcome! |
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. |
PHPStan 0.11
Summary of a problem or a feature request
I don't understand this one. Making a local
static
variable makes PHPStan think the variable can be afloat
when there's really no reason to. Removing thestatic
removes the error.Code snippet that reproduces the problem
https://phpstan.org/r/249d5f01-7caf-406d-bf12-5f6b116c3810
Expected output
No error.
The text was updated successfully, but these errors were encountered: