Skip to content

False positive always-true with in_array #5354

@VincentLanglet

Description

@VincentLanglet

I expect no error from the code
https://phpstan.org/r/179a9da2-e9e7-4d4b-b4af-b0e01c35a9db

In my project issue I get

Call to function in_array() with arguments 0, array<int, 0|1>&nonEmpty and true will always evaluate to true.

But even if the array is non-empty, the in_array check isn't supposed to be always true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions