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
Unset on a list should report an error #10506
Comments
if the last element in the list is unset that would still preserve the list type is, is it worth taking that into account? |
I don't think it remains a list. It also depends what happens when you append a new value after the unset using |
wow you are correct, you never stop learning weird aspects of php: |
Implemented phpstan/phpstan-src@aeadbe2 |
should we get the same error in this situation? |
ohh I got it now. the actual errors happens when we write the "no longer list" back into a variable/property which expects a list. the unset() itself is not the error. in my example it works by removing the list type from the variable involved |
Yes 😊 btw you can get the error now with by-ref parameter: https://phpstan.org/r/af367901-7930-4a8b-9bcd-42156f7a2860 |
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. |
Feature request
https://phpstan.org/r/31b7e82b-cbdf-4241-903a-11c2c92bebaf
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: