Skip to content

Bug: False positive for a problem already checked with an if (here with strpos()) #11601

@ThomasLandauer

Description

@ThomasLandauer

See https://psalm.dev/r/863d8d0859
In the top function this error is emitted:

Left operand cannot be falsable, got false|int<0, max>

The bottom function does the same, but has no error.

In this case, strpos() is used, but I guess it's a more general issue...

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