Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42496 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29009 invoked from network); 5 Jan 2009 20:39:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2009 20:39:34 -0000 Authentication-Results: pb1.pair.com header.from=shire@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=shire@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 69.63.177.213 as permitted sender) X-PHP-List-Original-Sender: shire@php.net X-Host-Fingerprint: 69.63.177.213 sizzo.org Linux 2.6 Received: from [69.63.177.213] ([69.63.177.213:39735] helo=sizzo.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/A8-07052-50072694 for ; Mon, 05 Jan 2009 15:39:34 -0500 Received: from shirebook.local (unknown [172.24.57.131]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by sizzo.org (Postfix) with ESMTPSA id 02CFB4FA511; Mon, 5 Jan 2009 12:39:30 -0800 (PST) Message-ID: <49627002.9020907@php.net> Date: Mon, 05 Jan 2009 12:39:30 -0800 Reply-To: shire@php.net User-Agent: Postbox 1.0b2 (Macintosh/2009010223) MIME-Version: 1.0 To: Felipe Pena CC: PHP Internals List , iliaa@php.net References: <495EF18A.7040206@php.net> <1230985623.3243.3.camel@pena> <1230985890.3243.6.camel@pena> <1230988421.3243.8.camel@pena> <495FBA65.4030001@php.net> <1231187760.3220.2.camel@pena> In-Reply-To: <1231187760.3220.2.camel@pena> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] PATCH: bug #46701 From: shire@php.net (shire) Felipe Pena wrote: > Hi, > > Em Sáb, 2009-01-03 às 11:20 -0800, shire escreveu: >> Felipe Pena wrote: >>> Em Sáb, 2009-01-03 às 10:31 -0200, Felipe Pena escreveu: >>>> Em Sáb, 2009-01-03 às 10:27 -0200, Felipe Pena escreveu: >>>>> Em Sex, 2009-01-02 às 21:03 -0800, shire escreveu: >>>>>> I've created a patch for bug #46701 (http://bugs.php.net/bug.php?id=46701) but it requires Zend changes, it can be found at the links below for all branches. I've verified all tests pass. We may want to verify it for other architectures due to the nature of it being a float conversion problem, I tested on Intel OS X 10.5.5. But this should at least be equivalent to $array[intval($double)] now. >>>>>> >>>>>> >>>>>> http://tekrat.com/patches/bug46701.php6.patch >>>>>> http://tekrat.com/patches/bug46701.php53.patch >>>>>> http://tekrat.com/patches/bug46701.php52.patch >>>>>> >>>>>> >>>>> I suppose that should we also change the fetch (ZEND_FETCH_DIM_*)? >>>>> >>>>> And probably: >>>>> case IS_DOUBLE: >>>>> index = (long)Z_DVAL_P(dim); >>>>> goto num_index; >>>>> >>>>> And zend_execute.c (zend_fetch_dimension_address_inner) will be >>>>> superfluous with this change. >>>> Errr, I mean, the case IS_DOUBLE stuff in >>>> zend_fetch_dimension_address_inner will be superfluous. >>>> >>> >>> In the end, I see that it requires the macro too, hehe. >>> So, a little change in your patch: >>> >>> - case IS_DOUBLE: >>> - index = (long)Z_DVAL_P(dim); >>> + case IS_DOUBLE: { >>> + DVAL_TO_LVAL(Z_DVAL_P(dim), index); >>> goto num_index; >>> - >>> + } >>> >> Hey, Good point Felipe, thanks! I've updated my patches as well to include this change and verified all the tests. >> > > I've committed it in 5_3 and HEAD. Ilia, should it be in 5_2 too? > > Thanks for the patch, Shire. ;) > Fantastic, thanks for the commit and additional fix! -shire