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
Comparison operation ">" between (int<min, X>|int<Y, max>|string) and Z is always true. #5295
Labels
Milestone
Comments
@neanton After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
- 9: Comparison operation ">" between (int<min, 4>|int<11, max>|string) and 10 is always true.
-18: Method Demo::getValue() return type has no value type specified in iterable type array.
+18: Method Demo::getValue() return type has no value type specified in iterable type array.
+18: Method Demo::getValue() should return array but return statement is missing. Full report
|
@neanton After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
- 9: Comparison operation ">" between (int<min, 4>|int<11, max>|string) and 10 is always true.
18: Method Demo::getValue() return type has no value type specified in iterable type array. Full report
|
Fixed: phpstan/phpstan-src@dd5633f |
ondrejmirtes
added a commit
to phpstan/phpstan-src
that referenced
this issue
Feb 28, 2022
Closes phpstan/phpstan#5893 Closes phpstan/phpstan#6070 Closes phpstan/phpstan#5869 Closes phpstan/phpstan#6212 Closes phpstan/phpstan#6262 Closes phpstan/phpstan#6266 Closes phpstan/phpstan#6023 Closes phpstan/phpstan#6108 Closes phpstan/phpstan#6020 Closes phpstan/phpstan#1746 Closes phpstan/phpstan#1516 Closes phpstan/phpstan#6174 Closes phpstan/phpstan#6112 Closes phpstan/phpstan#5749 Closes phpstan/phpstan#5969 Closes phpstan/phpstan#5295 Closes phpstan/phpstan#5675 Closes phpstan/phpstan#5369 Closes phpstan/phpstan#6699 Closes phpstan/phpstan#6505
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
The following snippet produces this error:
Seems like the problem is caused by
mixed
array key. Type hinting array returned fromgetValue
function to<int, int>
suppresses the warning.Code snippet that reproduces the problem
https://phpstan.org/r/e9007c26-e626-49e5-aa97-469e860ea8ea
Expected output
No error should be thrown
The text was updated successfully, but these errors were encountered: