[wp-trac] [WordPress Trac] #58012: Replace usage of strpos with str_starts_with

WordPress Trac noreply at wordpress.org
Wed Mar 29 13:57:10 UTC 2023


#58012: Replace usage of strpos with str_starts_with
--------------------------+----------------------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  needs-patch good-first-bug
  Focuses:                |
--------------------------+----------------------------------------
 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 ).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58012>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list