Bug #52861 unset failes with ArrayObject and deep arrays #289

Closed
wants to merge 1 commit into
from

4 participants

@mwillbanks

ArrayObject fails to unset multi-dimensional arrays. This is due to the code that fools ZE to believe we have a reference check. In this case it is missing BP_VAR_UNSET whereas BP_VAR_W and BP_VAR_RW are handled. Changing this resolves the overall issue. This does not cause a break in BC other than the obvious fixing of the bug. Thanks to @auroraeosrose for helping me locate and did it!

Example:

$arrayObject(array('foo' => array('bar' => array('baz' => 'boo'))));
unset($arrayObject['foo']['bar']['baz']);
// will not work: PHP Notice:  Indirect modification of overloaded element of ArrayObject.

The patch resolves this behavior which has been broken since 5.3.4.

@mwillbanks mwillbanks Bug #52861unset failes with ArrayObject and deep arrays
When checking to make into a reference write, readwrite are checked but not unset
d46d25f
@php-pulls

Comment on behalf of stas at php.net:

merged

@php-pulls php-pulls closed this Feb 27, 2013
@laruence
php.net member

this seems introduce issue: https://bugs.php.net/bug.php?id=66127

@mapthegod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment