-
Notifications
You must be signed in to change notification settings - Fork 548
Fix array_push with an empty constant array
#1210
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
Conversation
|
I noticed one thing here, that did not change: if e.g. |
|
Please push a test with https://phpstan.org/r/91ebaf38-ad93-499f-8f84-6382b13df4a8, I have an idea about it :) |
|
Pushed new tests and the implementation of the idea that I had as well :) It is a bit more complicated than I hoped it would be, maybe you have a better one. |
|
OK, I ended up basically re-writing the It seems like this is quite well covered via both |
|
found another thing (#1225) that will make things fail here atm, marking as draft for now again.. |
|
From my POV this would be ready. This PR improves The 10 failing |
|
Looks complicated, but probably worth it :) Thanks. |
Closes phpstan/phpstan#6974
While it would previously error with
Variable $a in empty() always exists and is not falsy., it errors now withVariable $a in empty() always exists and is always falsy.. I think this makes sense, because via empty array variadic parameter basically nothing is pushed onto the empty array, so it stays empty.The non-empty-array intersections are not needed because
setOffsetValueTypeshould be doing this internally already.