Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63190 invoked from network); 6 May 2014 11:25:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 May 2014 11:25:28 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.212.174 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:48740] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/31-53252-5A6C8635 for ; Tue, 06 May 2014 07:25:27 -0400 Received: by mail-wi0-f174.google.com with SMTP id r20so3769003wiv.1 for ; Tue, 06 May 2014 04:25:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Q6ulktUxPnce1YCn7n+3QsGgO/GH8ZGIcVhxArxtwL8=; b=RScsnpNBbzb85m5LNlgbtI65EnCkb6FgoQSaZg7t6jOtNAUA5V25hyUdCVV8VFm1hK Sa1Z5klrMTR41QDCDFXeHsqj1qbshF1NTnboQ5I+Yr1D8CLZgUFCqEVw1MtzfUcWK9qk qKXRL7TyCZzFEQDTFTy2OWVqczzU5MS4GgzC/cPcjCP86Q5IayqC/tkG1mdX9vCxyyM9 AbSTR3upn/J7J2gyegj/S74FGVw1QoumiZJE4DwAdXaNsW9nsUPoqZ+iBnXf+d5F2RyU FI/b2yQzjywaIL9EB4yJr6AJl/gPN/qXZuOfDxut8JLEoR7xxLx9qR7Fom4peMwkMvo7 HBbw== X-Gm-Message-State: ALoCoQkuTtYB2pruwZ45858gxeZtAdAaKT2/t18CIFefMn1eZOoWu5FOAFvr+ZdaQ87ALb8lebbJ+6IHD64Mc5+A6to4zdmeePBiMEUQT5sAVkeVPAq5+7KMpboyK9VKZYXOgpz7d48Z MIME-Version: 1.0 X-Received: by 10.180.78.225 with SMTP id e1mr2024935wix.17.1399375522498; Tue, 06 May 2014 04:25:22 -0700 (PDT) Received: by 10.227.234.6 with HTTP; Tue, 6 May 2014 04:25:22 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 May 2014 15:25:22 +0400 Message-ID: To: Tjerk Anne Meesters Cc: Julien Pauli , PHP Internals Content-Type: multipart/alternative; boundary=f46d043c0864ed1ff404f8b980f0 Subject: Re: 5dee3c11 break From: dmitry@zend.com (Dmitry Stogov) --f46d043c0864ed1ff404f8b980f0 Content-Type: text/plain; charset=UTF-8 I didn't review you patch careful, but why do you need to call offsetGet() when offsetExists() must be enough? is it for empty()? Then you probably should implement it a way similar to zend_std_has_dimension() in Zend/zend_object_handlers.c. call offsetExists() and then offsetGet() if necessary. Thanks. Dmitry. On Tue, May 6, 2014 at 2:31 PM, Tjerk Anne Meesters wrote: > Hi Dmitry, > > On Tue, May 6, 2014 at 4:11 PM, Dmitry Stogov wrote: > >> Hi Tjerk, >> >> your commit broke the code that worked fine before (still works in 5.5 >> but broken in 5.6 and above). >> It leads into infinity recursion until stack overflow. >> >> It must be fixed or reverted. >> > > This has been mentioned by Jakub before and a fix to ZF2 has already been > merged: > > https://github.com/zendframework/zf2/pull/6096 > > The previous code and my patch basically cannot coexist; it used to work > in 5.6 before, but only by the "virtue" of an unfortunate implementation. > > I believe this is not the only 5.6 issue that ZF2 is dealing with, but if > you feel that this breaks too many things for a 5.x release I suppose we > can revert it in PHP-5.6 and keep it for PHP-6? > > Let me know. > > >> Thanks. Dmitry. >> >> > class Parameters extends ArrayObject { >> public function __construct(array $values = null) { >> if (null === $values) { >> $values = array(); >> } >> parent::__construct($values, ArrayObject::ARRAY_AS_PROPS); >> } >> public function offsetGet($name) { >> if (isset($this[$name])) { >> return parent::offsetGet($name); >> } >> return null; >> } >> } >> $x = new Parameters(); >> var_dump($x['foo']); >> $x['foo'] = 'bar'; >> var_dump($x['foo']); >> ?> >> > > > > -- > -- > Tjerk > --f46d043c0864ed1ff404f8b980f0--