Bug report
array_shift can return null if the array is empty, and also make it empty if there was a last element. phpstan allows using array_shift even when there is a last element left in the array for the non-empty-list field type.
As a result, we have an empty list in the non-empty-list field, and we expect that array_shift will never return null.
Code snippet that reproduces the problem
https://phpstan.org/r/e92d9e9d-0f01-42d5-b04f-337ca8c64157
Expected output
error in test2
the reason is to make sure that there is more than one element in the array
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
array_shift can return null if the array is empty, and also make it empty if there was a last element. phpstan allows using array_shift even when there is a last element left in the array for the non-empty-list field type.
As a result, we have an empty list in the non-empty-list field, and we expect that array_shift will never return null.
Code snippet that reproduces the problem
https://phpstan.org/r/e92d9e9d-0f01-42d5-b04f-337ca8c64157
Expected output
error in test2
the reason is to make sure that there is more than one element in the array
Did PHPStan help you today? Did it make you happy in any way?
No response