Skip to content

Bad assumption about array key #12779

@hocker1

Description

@hocker1

Bug report

PHPstan seems to incorrectly narrow type after if (empty(...)).

Code snippet that reproduces the problem

https://phpstan.org/r/0554aa13-e165-4f18-b512-059cf0ab243e

Expected output

Dumped type should remain array<mixed> even after the if test (which may result false).

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions