Hello All,
The reference issues I previously noted were mostly about unset not being a
proper write context when the ZE is tricked into thinking it is a
reference; this is used for both write and read write but not unset.
This causes countless issues where you are unable to unset a
multi-dimensional array when using ArrayObject. You can do it IF and ONLY
IF each sub-array is an ArrayObject but in the context. You can see how
the bug works here: https://github.com/php/php-src/pull/289
If at all possible it would be fantastic to have this fixed for PHP master,
5.5, 5.4 and even 5.3. It causes a bunch of pain in userland especially if
you override $_SESSION with an ArrayObject or any other object for that
matter.
In ZF2 this has lead us to creating our own implementation of ArrayObject
simply to workaround this type of issue by using ArrayAccess and subsequent
friends. This has its own drawbacks and issues. For instance; assume that
you are setting a multi-dimensional array on ArrayObject:
$ar = new ArrayObject();
$ar['foo'] = array('bar' => 'foo');
unset($ar['foo']['bar']);
This would now fail and not remove the data as well as issue:
PHP Notice: Indirect modification of overloaded element of ArrayObject.
Since this is not a BC break and a bug fix that does have quite a bit of
impact it would be very nice to see if it can get fixed. If not for PHP
5.3 (which most people are using as a LTS version), 5.4 would certainly be
a good start.
- Mike