Re: Re: BC broken for strrpos()/strripos()

From: Date: Wed, 03 Dec 2003 01:46:49 +0000
Subject: Re: Re: BC broken for strrpos()/strripos()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-6043@lists.php.net to get a copy of this message
> >>What do you think? Is it ok to break the BC here or not? As you see the > >>other change introduced with the patch is to use the whole needle string > >>while searching, not only the first character. > >> > >That break was intentional. Having strrpos() behave differently from > >strpos() in regards to needle size was not a good thing. > > > In this case it should be stated somewhere maybe in the still imaginery > "the_thin_differences_between_PHP4_and_PHP5.txt" > Well, it's in the manual page (down at the bottom). (Note: Ignore the note about converting integers to strings, I've taken that out in light of undoing that particular BC breakage). But you're absolutely right, a spot in a yet-to-be-writen FAQ couldn't hurt. While I was in that file I fixed an offset reporting issue (offset didn't exist in 4.3 so it's not something to MFH) and introduced an optimized version of the string search for single character needles. In strrpos() it'll only be a minor difference, but strripos() saves a pair of needless emallocs. -Sara

« previous php.internals (#6043) next »