php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39775 "Indirect modification ..." message is not shown
Submitted: 2006-12-08 01:03 UTC Modified: 2006-12-08 17:46 UTC
From: toomuchphp-phpbugs at yahoo dot com Assigned: dmitry (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.2.0 OS: OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 2 = ?
Subscribe to this entry?

 
 [2006-12-08 01:03 UTC] 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
(
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-08 17:46 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC