Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6043 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36848 invoked by uid 1010); 3 Dec 2003 01:46:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36813 invoked by uid 1007); 3 Dec 2003 01:46:50 -0000 Message-ID: <20031203014649.36812.qmail@pb1.pair.com> To: internals@lists.php.net References: <3FCD2E06.6090809@hristov.com> <20031203005632.61115.qmail@pb1.pair.com> <3FCD3600.3030700@hristov.com> Date: Tue, 2 Dec 2003 17:46:49 -0800 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 169.229.139.92 Subject: Re: [PHP-DEV] Re: BC broken for strrpos()/strripos() From: pollita@php.net ("Sara Golemon") > >>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