#41116 [Opn->Asn]: Bogus "indrect modification ..has no effect" warning
| From: | jani@php.net | Date: | Wed, 18 Jul 2007 14:28:21 +0000 |
| Subject: | #41116 [Opn->Asn]: Bogus "indrect modification ..has no effect" warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115187@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: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: FreeBSD
PHP Version: 5CVS-2007-04-17 (CVS)
-Assigned To:
+Assigned To: helly
New Comment:
See also bug #42030 and bug #41641
Previous Comments:
------------------------------------------------------------------------
[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