<?php class Test { public $a = 1; public function &getA() {$a = [ &$this->a ]; return $a; } } $a = new Test(); $b = &$a->getA(); $a->a = 2; var_dump($b);
You have javascript disabled. You will not be able to edit any code.