-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
isset($foo['bar'])
should narrow down $foo
to array|object&ArrayAccess
#9991
Comments
Fixed: phpstan/phpstan-src@6fbd6e4 The error in I don't want to change the type of |
Thank you for the fast fix! I really appreciate it.
But it's not really a mixed, it's mixed~stdClass, and there's no way to have an object there: I read a discussion about narrowing json_decode type and I understand your point, but I'd be really nice to consider narrowing json_decode return type starting from any major PHPStan version. Because here's one of the pitfalls having it |
Yeah, sure, please do :) The problem with narrowing |
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
isset($foo['bar'])
should narrow down$foo
toarray|(object&ArrayAccess)
.Code snippet that reproduces the problem
https://phpstan.org/r/341ecc77-27a6-4459-bb59-4e5983393db1
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
💖
The text was updated successfully, but these errors were encountered: