Skip to content

array<non-empty-array> is not updated when using unset. #6170

@VincentLanglet

Description

@VincentLanglet

Bug report

When using unset on a non-empty-array and then checking for the number of element, there is no issue.
But if I call unset on an array of non-empty-array, and then checking for the number of the element, they are still considered as non-empty but they are possibly empty.

Code snippet that reproduces the problem

(https://phpstan.org/r/c9e905eb-a330-4504-9a6e-660b364e79ac)

Expected output

No error

Did PHPStan help you today? Did it make you happy in any way?

Phpstan is great, I'm trying to use the v1. Nice work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions