|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-25 19:35 UTC] derick@php.net
[2013-11-28 10:06 UTC] martijn dot otto at copernica dot com
[2013-11-28 14:22 UTC] nikic@php.net
[2013-11-28 14:39 UTC] martijn dot otto at copernica dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ While using __get and __set im getting the following notice : "Notice: Indirect modification of overloaded property $var has no effect " It worked perfect in previous PHP versions. Reproduce code: --------------- class myclass { /* $this->_data = array(1) { ["abcd"] => array(2) { ["a"] => string(2) "cc" ["b"] => string(2) "dd" } } */ public function __get($name) { $result = null; if (isset($this->_data[$name])) { $result = $this->_data[$name]; } return (array)$this->_data[$name] ; } public function __set($value, $arg) { foreach($arg as $key=>$inhoud) { $this->_data[$value][$key] = $inhoud; } } } $myclass = new myclass(); $myclass->abcd['a'] = 'ee'; //does not work anymore $myclass->newNode['a'] = 'ee'; //does not work anymore Expected result: ---------------- array(2) { ["abcd"] => array(2) { ["a"] => string(2) "ee" ["b"] => string(2) "dd" } ["newNode"] => string(2) "ee" } Actual result: -------------- Data does not change and outputs "Notice: Indirect modification of overloaded property $var has no effect "