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
False positive "Call to function is_array() with mixed will always evaluate to false" #6443
Comments
Hi. Here another one. Since 1.4.8 our tests fail with same code. 1.4.6 works fine. |
i stumbled on this issue as well and created an minimal testcase |
I'm getting a very similar error. The message itself looks like what it's saying can't be correct. The problem might be more general than just is_array(). |
@lightray22 Please attach a phpstan.org/try example. |
Here is an example showing both the is_array and is_string errors together. |
@gilbertsoft After the latest commit in 1.6.x, PHPStan now reports different result with your code snippet: @@ @@
-47: Call to function is_array() with mixed will always evaluate to false.
+38: Cannot access offset 'gilbertsoft/typo3…' on mixed.
+40: Cannot access offset 'gilbertsoft/typo3…' on mixed.
+46: Cannot access offset 'changes' on mixed.
+47: Call to function is_array() with mixed will always evaluate to false.
+47: Cannot access offset 'applied-changes' on mixed.
+54: Cannot access offset 'preferred-install…' on mixed. Full report
|
@brainfoolong After the latest push in 1.8.x, PHPStan now reports different result with your code snippet: @@ @@
-16: Call to function is_array() with mixed will always evaluate to false.
+No errors |
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
Looks PHPStan is reporting a false positive "Call to function is_array() with mixed will always evaluate to false" in some circumstances.
Code snippet that reproduces the problem
https://phpstan.org/r/f4b7baf4-e5ac-4cb5-9f46-5dabb7296eb7
Expected output
No error.
The text was updated successfully, but these errors were encountered: