Skip to content

Type information lost during array key affectation ? #4165

@greg0ire

Description

@greg0ire

Bug report / Feature Request? I'm not sure…

It seems that under some conditions, PHPStan generalizes a "finite" (not sure what the right term is) type to an "infinite" one.

Code snippet that reproduces the problem

https://phpstan.org/r/1d06b068-483f-483e-a0cf-ef0ff3a29ade

Expected output

No errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions