Skip to content

Replace usage of strpos with str_starts_with etc. #1373

@rugk

Description

@rugk

The problem

Replace usage of 0 === strpos or 0 !== strpos with str_starts_with. It makes the code more readable and use a PHP native function ( which may have a performance benefit ).

as https://core.trac.wordpress.org/ticket/58012 e.g.

from https://github.com/PrivateBin/PrivateBin/pull/1370/files#r1667708220

#1370

The solution

Search the codebase for this and change all instances…

Alternatives

Not upgrade, PHP is backeard-compatibility. But for maintenance reasons and to prevent further misunderstandings, this is an important step nevertheless.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions