🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

in_array - report finite types in constant array haystack that can never be needle #14960

Description

@ondrejmirtes

Feature request

https://phpstan.org/r/b01b0b02-d1b4-4726-ab4a-be93066af673 - should report that int can never be Foo::ONE.

The logic should use the type system, so Type::getConstantArrays() and Type::getFiniteTypes(), not AST (Array_, Scalar etc.).

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions