Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27707 invoked from network); 5 Jan 2009 20:35:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2009 20:35:31 -0000 Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.250 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.132.250 an-out-0708.google.com Received: from [209.85.132.250] ([209.85.132.250:23797] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/68-07052-01F62694 for ; Mon, 05 Jan 2009 15:35:29 -0500 Received: by an-out-0708.google.com with SMTP id b2so2735037ana.38 for ; Mon, 05 Jan 2009 12:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=PtzBn0OtQqUaIpKHoqGF15MLw8uBfHZqUdSZwR9x/YI=; b=CDNKFsgETWi6aoULNfVYmp5c5NLfQMNskZUHWV3M6rqPc5RQGOtJncqaV1+Voxmynf l9NunTfUqndkRLkuyqQhR7MHIFSvnKj43mYh5yTKfkmiE4aONc1IbXusjKbSZ9fhe3fM lU1BsGpX+nSSv3xqV3C6PmEAJ47/bakjBbUfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=Qx6WXp9rmR1qKi5YH6HIeQnxmpx9RXMY7M30XmKsVrG07Q6dCpqpqLZPrUGGlurvTt xPyu/hTAr5/w5vP6gCRNw0XOs4VQ3Ado+0buqcyyOqfXhOtBOBddCAD5xY+DYgS7My5B fe6PZKd3haugfbEfVMr9ACs9/M/5UkLkU8SqE= Received: by 10.100.105.13 with SMTP id d13mr11246027anc.95.1231187724672; Mon, 05 Jan 2009 12:35:24 -0800 (PST) Received: from ?192.168.1.3? ([189.24.64.206]) by mx.google.com with ESMTPS id c37sm27793236ana.37.2009.01.05.12.35.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Jan 2009 12:35:24 -0800 (PST) To: shire@php.net Cc: PHP Internals List , iliaa@php.net In-Reply-To: <495FBA65.4030001@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> Content-Type: text/plain; charset=UTF-8 Date: Mon, 05 Jan 2009 18:36:00 -0200 Message-ID: <1231187760.3220.2.camel@pena> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] PATCH: bug #46701 From: felipensp@gmail.com (Felipe Pena) 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. ;) -- Regards, Felipe Pena