#39775 [Opn->Asn]: "Indirect modification ..." message is not shown
| From: | tony2001@php.net | Date: | Fri, 08 Dec 2006 13:50:10 +0000 |
| Subject: | #39775 [Opn->Asn]: "Indirect modification ..." message is not shown | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106085@lists.php.net to get a copy of this message | ||
ID: 39775
Updated by: tony2001@php.net
Reported By: toomuchphp-phpbugs at yahoo dot com
-Status: Open
+Status: Assigned
Bug Type: Class/Object related
Operating System: OS X
PHP Version: 5.2.0
-Assigned To:
+Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2006-12-08 01:03:30] toomuchphp-phpbugs at yahoo dot com
Description:
------------
If a __get() method returns a variable which is a reference, the
'Indirect modification of ...' error will not be shown.
Reproduce code:
---------------
class test {
var $array = array();
function __get($var) {
$v =& $this->array;
return $this->array;
}
}
$t = new test;
$t->anything[] = 'bar';
print_r($t->anything);
Expected result:
----------------
Notice: Indirect modification of overloaded property test::$anything
has no effect in test.php on line 10
Array
(
)
Actual result:
--------------
Array
(
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39775&edit=1