Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43433 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58250 invoked from network); 23 Mar 2009 13:30:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Mar 2009 13:30:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.151.69.1 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.151.69.1 liberty.vosn.net Linux 2.4/2.6 Received: from [209.151.69.1] ([209.151.69.1:40028] helo=liberty.vosn.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/2B-05588-CFE87C94 for ; Mon, 23 Mar 2009 08:30:36 -0500 Received: from 75-121-92-184.dyn.centurytel.net ([75.121.92.184]:49350 helo=pc1) by liberty.vosn.net with smtp (Exim 4.69) (envelope-from ) id 1LlkEa-0002KH-O7; Mon, 23 Mar 2009 07:30:33 -0600 Message-ID: <3E59E2234B594B84BBA2F22D9AEBDFFA@pc1> To: , "Dmitry Stogov" Cc: "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> Date: Mon, 23 Mar 2009 08:30:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - liberty.vosn.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - realplain.com Subject: Re: [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int From: php_lists@realplain.com ("Matt Wilmas") 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. ----- 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 > Thanks. Dmitry. - Matt