Skip to content

Error recognizing key value in array in case of union #6728

@janbarasek

Description

@janbarasek

Bug report

PhpStan will incorrectly overwrite the value of the key in the array if it was defined as union.

Snímek obrazovky 2022-03-03 v 15 02 43

Code snippet that reproduces the problem

https://phpstan.org/r/b9b6eddd-b448-4642-bc09-8bfc4555712f

Expected output

In the case of a union of multiple different arrays, the context should correctly identify which array I just used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions