Skip to content

infer types based on non-strict equality with constant types #10481

Open
phpstan/phpstan-src
#2889
@staabm

Description

Feature request

IMO phpstan should narrow types of non-strict comparisions, in case the comparison is done against a constant value, which cannot change meaning when interpreted in a loose-comparison

https://phpstan.org/r/297bee27-5cf8-49ff-9a71-08a73c0aef8b
should not report type assertion errors

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

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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