[wp-trac] [WordPress Trac] #64773: Code Modernization: Replace usage of strpos() with str_starts_with().

WordPress Trac noreply at wordpress.org
Mon Mar 2 08:37:58 UTC 2026


#64773: Code Modernization: Replace usage of strpos() with str_starts_with().
------------------------------+-----------------------------
 Reporter:  Soean             |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  7.0
Component:  General           |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------------
Description changed by SergeyBiryukov:

Old description:

> In 2023 we replaced `0 === strpos()` with `str_starts_with()` see #58012
>
> In 2024 we introduced a new `0 === strpos()` see
> https://core.trac.wordpress.org/changeset/58313
>
> To improve readability and performance, we should also update it with
> `str_starts_with()`.

New description:

 In 2023 we replaced `0 === strpos()` with `str_starts_with()` see #58012

 In 2024 we introduced a new `0 === strpos()` see [58313].

 To improve readability and performance, we should also update it with
 `str_starts_with()`.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64773#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list