Skip to content

strlen wrongly narrows down string type #9205

@alies-dev

Description

@alies-dev

https://psalm.dev/r/f5d6d67011

It seems like Psalm think $lastLabel is a falsy-string ($lastLabel: ''|'0') for some reason when I use a check like:

if (strlen($lastLabel) === 2) {
        return $lastLabel;
    }

Not sure is it related to strlen other another part of this code

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