Re: PHP 6.0 Wishlist

From: Date: Sun, 14 Aug 2005 03:43:41 +0000
Subject: Re: PHP 6.0 Wishlist
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-18028@lists.php.net to get a copy of this message
    Yeah. It's propably best to leave these alone. :)
    --Jani
On Sat, 13 Aug 2005, Wez Furlong wrote:
I really doubt this will change. It would be a *huge* mess in the docs and peoples scripts and brains if we did change it--it wouldn't really win anyone anything: function portable_strpos($needle, $haystack) { if (version_compare(phpversion(), "6.0"))) { return strpos($needle, $haystack); } else { return strpos($haystack, $needle); } } --Wez. On 8/13/05, Ryan King <ryan@theryanking.com> wrote:
On Aug 13, 2005, at 6:50 PM, Jani Taskinen wrote:
On Sat, 13 Aug 2005, Sara Golemon wrote:
    This is the first one that comes to my mind:
      int strpos (string haystack, mixed needle [, int offset])
And this is why they're inconsistent to begin with. When I look at strpos() I think: strchr(char *, int) So the parameter ordering does make sense there (to me).
    Yes, coming from a C background you would think like that.
    But when you think about it with some logic (not women's logic :):
    "I'm looking for a character inside a string."
Or looking for a *needle* in a *haystack*. -ryan
    Thus: strpos(needle, haystack) is the correct way (tm) =)
I agree, though I don't really care so long as its the same in all the str* and array* functions -ryan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- Donate @ http://pecl.php.net/wishlist.php/sniper

« previous php.internals (#18028) next »