Skip to content

Function empty on array and parent population conflict on unset #4289

@chr-hertel

Description

@chr-hertel

Bug report

When combining an empty($array) with a parent::populateArray the unset($array['xyz']) raises an Cannot unset offset 'xyz'. Which is incorrect if populated by parent call.

Code snippet that reproduces the problem

https://phpstan.org/r/492c618a-e7e9-4207-89c8-808667b93ae4

Expected output

Phpstan respects the parent call and throws no error.

Thanks already for having a look! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions