Re: PHP 6.0 Wishlist

From: Date: Sun, 14 Aug 2005 06:05:45 +0000
Subject: Re: PHP 6.0 Wishlist
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-18041@lists.php.net to get a copy of this message
> >> 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." > > Thus: strpos(needle, haystack) is the correct way (tm) =) no, it should be "$a = (look for $needle inside $hystack);", and can never be a php language if we always strict the garmmar of native language to be a basic of a programming language, we might mixed everything up. until the day your computer passed turin turing test. > I agree, though I don't really care so long as its the same in all > the str* and array* functions but sadly it's not. for str_replace, the 3rd argument is more or less a "haystack" and the 1st argument is needle

« previous php.internals (#18041) next »