Skip to content

non-empty-string is not always truthy #5317

@BackEndTea

Description

@BackEndTea

Bug report

if the length of a string is 1, it is not necessarily truthy. if it is '0', the string is fasly

Code snippet that reproduces the problem

https://phpstan.org/r/0d0ff87d-1142-4c8d-887a-9ea257c0540b
https://phpstan.org/r/af765852-8582-480e-8225-6457ee0b214e
https://3v4l.org/BeHAV

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions