ID: 41116
Updated by: [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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