Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73318 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49568 invoked from network); 20 Mar 2014 02:41:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2014 02:41:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:41526] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/43-33112-C555A235 for ; Wed, 19 Mar 2014 21:41:33 -0500 Received: by mail-vc0-f180.google.com with SMTP id lf12so232599vcb.25 for ; Wed, 19 Mar 2014 19:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=u2kKIURDiqfRB6hq3hSybwv8RkiAkjJYzKQ0V0vGwLU=; b=mtaeAAY6kYen7Mn4GlNAsDYXHhi4VVBRwxMV7TuoMcV6W3C8FkRl8tu41a2ts48X8J Qnj+eMA3fDGyGf6xT42xVJBX71kFTTnc9sZ7909c/80aXd3qaeHMVWt6NI9N11BPDbSG JJHdY+td7fRMRLsD9vFezxy/AXNSF+ZhECQbVBCpGoHoWMSX9x16UhVthOG8+v1gWxds RNB41cyY8pZOQy36vMeB3j9/3VQ+NIun7xTag6tTKL8JzAs5iYRAgTg+y02hl9wUKLvC 8nnqqEtbBvvuKBbmQIzhwwVmal7lUfGSPzvx+Px8Vd48RmFrv6YjmsptWXsruTO8iBs4 U3UQ== MIME-Version: 1.0 X-Received: by 10.221.34.7 with SMTP id sq7mr206652vcb.5.1395283289340; Wed, 19 Mar 2014 19:41:29 -0700 (PDT) Received: by 10.58.55.131 with HTTP; Wed, 19 Mar 2014 19:41:29 -0700 (PDT) In-Reply-To: References: <532A3E88.20202@sugarcrm.com> <532A418A.8020607@sugarcrm.com> Date: Thu, 20 Mar 2014 10:41:29 +0800 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1136526ad280d604f500b43a Subject: Re: [PHP-DEV] Merge PR 621 From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a1136526ad280d604f500b43a Content-Type: text/plain; charset=ISO-8859-1 Sorry, I hit "Send" too soon. On Thu, Mar 20, 2014 at 10:36 AM, Tjerk Meesters wrote: > > > > On Thu, Mar 20, 2014 at 9:16 AM, Stas Malyshev wrote: > >> Hi! >> >> > Yes, that's probably what it was supposed to do, but as you can see >> > from bug 66834 that's clearly not the case. I had earlier approached >> > the problem purely from SPL standpoint (see linked PR) but Etienne >> > said that it would be a better idea to tackle this issue further up >> > the chain so to speak :) >> >> I think we need to first find out why that code did not work, instead of >> ripping out the code that already was supposed to do exactly what this >> bug is saying and replacing it with other code. > > > Here's my earlier work on this: https://github.com/php/php-src/pull/614 > > It currently "doesn't work" because isset()/empty() work like > array_key_exists() on objects that extend ArrayObject, which is in some > cases not the desired behaviour; see also: > http://lxr.php.net/xref/PHP_5_6/ext/spl/spl_array.c#604 > > If 'offsetExists()' is not overridden, the logic is done correctly; see > also: http://lxr.php.net/xref/PHP_5_6/ext/spl/spl_array.c#617 > I forgot to mention that the current behaviour is not necessarily correct if `offsetGet()` is overridden in a child class; the overridden method may decide to return `null` or something empty. > The behaviour is currently correct inside zend_std_has_dimension(), so > making the fix in SPL alone (#614) would make performance "suffer" less > unless offsetGet() is overridden. > > Personally I'm fine either way; like I said, my first patch was only done > in SPL when Etienne suggested the approach in #621. > > >> At least we need to know >> the reason why that did not work. So please do not merge this patch >> until we know what's going on there. >> >> -- >> Stanislav Malyshev, Software Architect >> SugarCRM: http://www.sugarcrm.com/ >> (408)454-6900 ext. 227 >> > > > > -- > -- > Tjerk > -- -- Tjerk --001a1136526ad280d604f500b43a--