Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68480 invoked from network); 3 Jan 2009 19:20:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2009 19:20:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=shire@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=shire@php.net; 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:48272] helo=sizzo.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/EA-01547-96ABF594 for ; Sat, 03 Jan 2009 14:20:12 -0500 Received: from shirebook.tekrat.com (dsl092-189-079.sfo1.dsl.speakeasy.net [66.92.189.79]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by sizzo.org (Postfix) with ESMTPSA id E30F64FA454; Sat, 3 Jan 2009 11:20:05 -0800 (PST) Message-ID: <495FBA65.4030001@php.net> Date: Sat, 03 Jan 2009 11:20:05 -0800 Reply-To: shire@php.net User-Agent: Postbox 1.0b1 (Macintosh/2008121616) MIME-Version: 1.0 To: Felipe Pena CC: PHP Internals List References: <495EF18A.7040206@php.net> <1230985623.3243.3.camel@pena> <1230985890.3243.6.camel@pena> <1230988421.3243.8.camel@pena> In-Reply-To: <1230988421.3243.8.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: > 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. -shire