php - __get causes "Cannot assign by reference to overloaded object" -



php - __get causes "Cannot assign by reference to overloaded object" -

class { } class b { public function __get($name) { // nil } } // works $a = new a; $x = new stdclass(); $a->test =& $x; // fatal error: cannot assign reference overloaded object on line 21 $b = new b; $y = new stdclass(); $b->test =& $y;

how , why existence of magic getter cause error?

php overloading getter

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -