Re: 5dee3c11 break

From: Date: Tue, 06 May 2014 10:31:40 +0000
Subject: Re: 5dee3c11 break
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-73962@lists.php.net to get a copy of this message
Hi Dmitry, On Tue, May 6, 2014 at 4:11 PM, Dmitry Stogov <dmitry@zend.com> 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. > > <?php > 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

« previous php.internals (#73962) next »