Skip to content

always false substr() comparison with literal strings #15324

Description

@staabm

Feature request

when comparing a substring against a literal-string we should detect cases which are always false, when the substring beeing extracted will always be shorter than the compared literal

https://phpstan.org/r/03fb4bf7-03f0-4fed-a254-dfd161d4b66d
https://3v4l.org/lKEen#v

there are likely more string functions this can be applied to

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions