Skip to content

Dynamic array key access does not work if key is optional even after isset() #7000

@Seldaek

Description

@Seldaek

Bug report

This shows it best.

https://phpstan.org/r/5bd531ea-0a41-4be8-bbf9-3ca42e8d0bbe

It seems to be a "regression" of the 1.5.4 release which is unsurprising given it fixed a lot of issues related to arrays. But I do believe the behavior is incorrect and hope it can be fixed.

Expected output

No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions