Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43436 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80509 invoked from network); 23 Mar 2009 14:16:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Mar 2009 14:16:46 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:23844] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/52-03220-BC997C94 for ; Mon, 23 Mar 2009 09:16:45 -0500 Received: from ws.home ([10.1.10.24]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 23 Mar 2009 16:16:09 +0200 Message-ID: <49C799C5.6040509@zend.com> Date: Mon, 23 Mar 2009 17:16:37 +0300 User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Matt Wilmas CC: internals@lists.php.net, Lukas Kahwe Smith , =?ISO-8859-1?Q?Johannes_Schl=FCter?= References: <1113CE12226949C2939A31971420991F@pc1> <49C0A7C7.8000804@zend.com> <12E613FAA1C9422B948F00B61AD32366@pc1> <49C134E5.7020706@zend.com> <570D833B543A4EB599F982488CDC41E4@pc1> <49C1E2ED.8080907@zend.com> <62A879A44B7A45AAB19266AB34ECDFA6@pc1> <49C39218.6000209@zend.com> <3E59E2234B594B84BBA2F22D9AEBDFFA@pc1> In-Reply-To: <3E59E2234B594B84BBA2F22D9AEBDFFA@pc1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Mar 2009 14:16:10.0405 (UTC) FILETIME=[EA42BD50:01C9ABC1] Subject: Re: [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int From: dmitry@zend.com (Dmitry Stogov) Hi Matt, Matt Wilmas wrote: > Hi Dmitry, > > While updating my version (more below), I noticed another problem that I > overlooked before with your leading zero check: "-0" is being treated as > numeric. Yeah. Thank you for catching this. It should be fixed. > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Friday, March 20, 2009 > >> Hi Matt, >> >> I ran you version but it looked little bit slower (I checked it with >> callgrind). So I kept the current CVS version. Anyway, it is not a big >> problem to change it after RC. > > Yeah, after I sent that message, I noticed other times were strange > (bench.php, etc.), so it looks like I was getting compiler weirdness > with that code layout... And of course looking at the code, there > shouldn't have been anything faster about it, though it was shorter, > which you confirmed with callgrind. > > Anyway, my updated version seems good, still smaller, and should do > better with callgrind. :-) On 32-bit, the first digit of a 10 digit > number can be checked which avoids having "2x overflow" on "5000000000", > etc. that I pointed out with your original code. (No problem on > 64-bit.) Also made the terminating null check be last again since it's > least likely to fail... > > http://realplain.com/php/handle_numeric.txt > OLD: http://realplain.com/php/handle_numeric-v1.txt It looks like now your version must be better. Are you sure that it can't miss overflow? Can it be proved? Thanks. Dmitry. >> Thanks. Dmitry. > > - Matt