<?php class X { public $bar = 1; function __construct($a) { $this->bar = $a; } } function foo1(&$test) { $test = new X(12); } function foo2($test){ $test = new X(12); } $n = new X(0); foo2($n); var_dump($n); foo1($n); var_dump($n);
You have javascript disabled. You will not be able to edit any code.