Skip to content

array_key_exists false positive #14177

@ondrejmirtes

Description

@ondrejmirtes

Bug report

Not sure when it first appeared, somewhere between Feb 12 and Feb 20.

Code snippet that reproduces the problem

https://phpstan.org/r/55bf8286-9803-44ea-bf77-236cc7ce4e92

Expected output

The array shape says that key 2 is optional, so array_key_exists is not always true.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions