Skip to content

Strict check when writing to array #3703

@eigan

Description

@eigan

Bug/Feature report

Writing to array should verify that the type is correct.

Code snippet that reproduces the problem

https://phpstan.org/r/d6bd5e2f-c8e7-4b07-b0ab-dc02940c71e4

Expected output

$array expects array<string, array<string, array<int>>>, array<string, array<string, array<int, string>>> given

Not sure how to handle $array = [].

Relates to #3311 though it looks to be specific to non-keyed arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions