<?php class Foo { public readonly int $bar; public function set(int $i) { $this->bar = &$i; } } $i = 1; $foo = new Foo(); $foo->set($i); $i = 20; var_dump($foo->bar);
You have javascript disabled. You will not be able to edit any code.