Skip to content

PossiblyFalseOperand: false is not erased after > 0 comparison #8745

@derrabus

Description

@derrabus

Found while testing 5.0.0-rc1

https://psalm.dev/r/72fd1e5782

A variable typed as int|false is compared with zero ($length > 0). Afterwards, Psalm correctly infers that it has to be 1 or higher (int<1, max>). But it still considers false to be possible although (false > 0) === false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions