Skip to content

Wrong inference about array from PHPStan #8087

@VincentLanglet

Description

@VincentLanglet

Bug report

I suspect that some optimisation about array is creating an issue
@ondrejmirtes @rvanvelzen

Code snippet that reproduces the problem

https://phpstan.org/r/7aacecc5-cd35-4ec4-98ae-c70b4635e1ef

Doing things on one key of the array is automatically changing the way phpstan is inferring the other key (and the whole array).

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