Skip to content

Unsetting array keys after checking their existence give strange behaviour #3544

@BackEndTea

Description

@BackEndTea

Bug report

Checking if an array key exist, and then throwing an exception/ returning when it does not makes it so the array can not be empty, even when it is unset

Code snippet that reproduces the problem

https://phpstan.org/r/74c5fd68-3156-4618-9b1e-a7db1cf3f0f6

Expected output

I'd expect no errors here, as the array can be empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions