|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-18 14:28 UTC] jani@php.net
[2007-07-19 13:01 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 14:00:01 2025 UTC |
Description: ------------ When setting value to an object returned from an overloaded array produces bogus "Indirect modification of overloaded element of foo has no effect" warning Reproduce code: --------------- <?php class foo implements ArrayAccess { private $array; public function offsetSet($key, $value) { $this->array[$key] = $value; } public function offsetGet($key) { return $this->array[$key]; } public function offsetExists($key) {} public function offsetUnset($key) {} } $foo = new foo; $std = new stdclass; $foo["bar"] = array($std); $foo["bar"][0]->std = "foo"; var_dump($foo); Actual result: -------------- Notice: Indirect modification of overloaded element of foo has no effect in /usr/home/bjori/test/bogus.warning.php on line 17 object(foo)#1 (1) { ["array:private"]=> array(1) { ["bar"]=> array(1) { [0]=> object(stdClass)#2 (1) { ["std"]=> string(3) "foo" } } } }