Skip to content

Always false error does not mention subtracted type causing misleading error messages #10421

@janedbal

Description

@janedbal

Bug report

See snippet, it says Strict comparison using === between mixed and null will always evaluate to false. (which is nonsense)

Code snippet that reproduces the problem

https://phpstan.org/r/28b35ed4-f3d5-427b-83b8-44599bc42f15

Expected output

The error message should be sth like Strict comparison using === between mixed~null and null will always evaluate to false.

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