Skip to content

False positive "Offset does not exist" when populating with foreach #2294

@pontus-mp

Description

@pontus-mp

Bug report

Using foreach to overwrite the values in an array seems to make phpstan confused about that array.

Code snippet that reproduces the problem

https://phpstan.org/r/73a29f4c-ae8e-4e22-bb61-c22a5d3e618c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions