Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66465 invoked from network); 29 Jul 2011 05:27:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2011 05:27:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierrick@webstart.fr; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pierrick@webstart.fr; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webstart.fr from 209.85.210.44 cause and error) X-PHP-List-Original-Sender: pierrick@webstart.fr X-Host-Fingerprint: 209.85.210.44 mail-pz0-f44.google.com Received: from [209.85.210.44] ([209.85.210.44:59127] helo=mail-pz0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/E2-35879-0D4423E4 for ; Fri, 29 Jul 2011 01:27:44 -0400 Received: by pzk5 with SMTP id 5so7672634pzk.31 for ; Thu, 28 Jul 2011 22:27:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.14.3 with SMTP id l3mr1668042pbc.180.1311917261308; Thu, 28 Jul 2011 22:27:41 -0700 (PDT) Received: by 10.68.49.2 with HTTP; Thu, 28 Jul 2011 22:27:41 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Jul 2011 01:27:41 -0400 Message-ID: To: Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Bug #50816 From: pierrick@webstart.fr (Pierrick Charron) Hi again, #50816 is due to the fact that the function zend_hash_update_current_key_ex try to determinate if an element of the array is before/after an other one with the new key by looking at their position in the Bucket. The problem is that the key of the element we want to change is not the same as the other one which mean they're not always in the same Bucket (almost never). The only solution I found was to determine which element is first by looping into the array itself element per element. I tried to optimise the patch by first making sure the second element exists so that I don't loop on the array for nothing. The "optimised" patch can be found here : http://www.adoy.net/php/50816-2.diff If someone has a better solution I'll be please to read it. Thanks Pierrick On 28 July 2011 20:57, Pierrick Charron wrote: > Hi, > > I added a patch on #50816. I'm not sure the approach to fix this bug > is the best one so if someone can give me some feedback ? > > Thanks > Pierrick >