-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#3952Labels
Milestone
Description
Bug report
array_splice has 2 issues:
- it does not preserve the
liststatus of an array passed as argument when inserting new elements in the array, while PHP returns a list in that case: https://3v4l.org/TdJpn - it keeps the key type as a union of literal integers, while inserting new elements will add new keys in the array, which won't match that union
Code snippet that reproduces the problem
https://phpstan.org/r/cfd4bca9-57fb-4181-8c8a-f0b6d8823ebb
Expected output
No error reported for that code (not counting the type debugging of course)
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable