Skip to content

Wrong type inference on array when setting values on it #6173

@VincentLanglet

Description

@VincentLanglet

Bug report

Code snippet that reproduces the problem

(https://phpstan.org/r/183caf26-e741-46be-b8ab-b93af9f082aa)

Expected output

No error, the array should be considered as array{foo?: int, bar?: int}

Did PHPStan help you today? Did it make you happy in any way?

Sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions