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
Array destructuring: Variable always exists and is not falsy. #7724
Comments
Yep, as you wrote already: looks like an array creation problem using destructuring. It even happens with a single array. See https://phpstan.org/r/2e4cb1ab-2d1c-43cb-aed7-c65790248dcd I think I recently fixed a similar thing in |
Another example: https://phpstan.org/r/f1e8a5dc-25f1-44c2-8aa5-d175b15a545f / https://3v4l.org/Ioup2 from my duplicated issue: #7736 |
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
phpstan asummes destructuring array as not empty
Code snippet that reproduces the problem
https://phpstan.org/r/645cd80c-ea2b-41f2-9399-11bae7aca398
Expected output
No errors
The text was updated successfully, but these errors were encountered: