-
-
Notifications
You must be signed in to change notification settings - Fork 947
List + unset last item is not a list anymore #12768
Copy link
Copy link
Closed
Description
Bug report
Phpstan thinks $arr after unset($arr[n]); is never a list anymore, but that's not true if n is the last item.
Code snippet that reproduces the problem
https://phpstan.org/r/06411cac-e555-47a5-adbe-35c67b527741
Expected output
No error. array{0: 1, 1: 2, 2?: 3} is a list. With the phpdoc certain checkbox checked it's even more obvious: array{1, 2} is definitely a list.
More realistic but less readable example: https://phpstan.org/r/7375b8d0-2bc7-4ec5-a179-2459434273d2
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels