[wp-trac] [WordPress Trac] #19347: Ugly alert: false !== strpos( $which_one_was_needle, $this_one )

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 23 22:21:07 UTC 2011


#19347: Ugly alert: false !== strpos( $which_one_was_needle, $this_one )
---------------------------------------------+-----------------------------
 Reporter:  nbachiyski                       |       Owner:  westi
     Type:  enhancement                      |      Status:  reviewing
 Priority:  normal                           |   Milestone:  Future Release
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch westi-likes 3.4-early  |
---------------------------------------------+-----------------------------

Comment (by nacin):

 Remembering haystack/needle order is a pain and something that all still
 venture to php.net for on a regular basis.

 However, wp_in() still ends up being reversed from startswith() and
 endswith(). Sure, it's natural with the whole verb thing, but it requires
 one to switch contexts and think about it a little more than "oh, the
 haystack is always going to be first." So I don't know how much I like
 this. I feel like adding new functions on top of this will only end up
 making it more difficult to follow code, not less.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19347#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list