Skip to content

False positive with when using in_array with literals (or constants) #5496

@faizanakram99

Description

@faizanakram99

Bug report

latest version (reproduced at phpstan.org)

See line 22 of attached snippet, the array is missing 'auto' value yet phpstan reports that \in_array('auto', $propagation, true) will always return true (at line 18)

Code snippet that reproduces the problem

https://phpstan.org/r/00e38865-bbc2-4373-8655-e2f1a3c6c14a

Expected output

No errors

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

Indeed. Thanks for the great tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions