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
Cannot unset offset 'Review' on array{User: mixed}. #8113
Comments
The type gets broken after the unset on line 37: https://phpstan.org/r/f3a3a3dd-3e92-4fb7-bddf-70e088850ed0 |
The bug is only in 1.8.7 and above though, right? For me, it's working in 1.8.6. |
@ondrejmirtes could it be related to phpstan/phpstan-src#1791? |
I don't think so, but you can always verify that by reproducing the bug and reverting your fix 😎 |
I tested only in 1.8.7. But also present in 1.8.8 |
Here is another similar but even simpler case: https://phpstan.org/r/0f640c5d-beb7-4c90-8b8b-142dd8ffebbc |
@paulijar your case is not exactly the same because offset |
True. However, in my real-life case the array was actually parsed from a file so PhpStan had no chance to know its full contents, and I still got the same error message. And the code should be totally correct regardless of if |
Indeed the issue with my real-life code got fixed by Phpstan 1.9.2. 👍 |
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. |
https://phpstan.org/r/f6f1e028-bcfa-4914-8189-82afd1e99de4
this seems like a bug in the latest version 1.8.6
The text was updated successfully, but these errors were encountered: