--TEST-- Bug #39297 (Memory corryption because of indirect modification of overloaded array) --FILE-- children[$cannonicalName] = $value; $value->parent = $this; } public function offsetGet($offset) { echo "offsetGet()\n"; $cannonicalName = strtolower($offset); return $this->children[$cannonicalName]; } } $id = 'Test'; $root = new MyTree(); $child = new MyTree(); $root[$id] = $child; var_dump(compareByRef($root[$id], $child)); ?> --EXPECT-- offsetSet() offsetGet() bool(true)