Skip to content

PHPStan 1.8.3 - Array shape guessing is missing some keys (array_key_exists/isset is alway falsy even if not) #7898

@kissifrot

Description

@kissifrot

Bug report

When using isset() or array_key exists() on multidumensional array, array shape is somewhat lost.
PHPStan 1.8.2 was fine though.

Code snippet that reproduces the problem

https://phpstan.org/r/4237e5f0-169f-44a4-8bd9-1970b08924bf

Expected output

There should be no error since both bar and foo keys exist, however dumped type misses the foo key

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

PHPStan is a great tool, except when updates break it 😁

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions