#41116 [Asn->Bgs]: Bogus "indrect modification ..has no effect" warning

From: Date: Thu, 19 Jul 2007 13:01:50 +0000
Subject: #41116 [Asn->Bgs]: Bogus "indrect modification ..has no effect" warning
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115234@lists.php.net to get a copy of this message
ID: 41116 Updated by: jani@php.net Reported By: hannes dot magnusson at gmail dot com -Status: Assigned +Status: Bogus Bug Type: Scripting Engine problem Operating System: FreeBSD PHP Version: 5CVS-2007-04-17 (CVS) Assigned To: helly New Comment: No need to keep multiple reports open about this..see above bugs instead. Previous Comments: ------------------------------------------------------------------------ [2007-07-18 14:28:21] jani@php.net See also bug #42030 and bug #41641 ------------------------------------------------------------------------ [2007-04-17 12:14:36] hannes dot magnusson at gmail dot com 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" } } } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41116&edit=1

« previous php.bugs (#115234) next »