3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { readonly int $y; public function test(&$x) { $x = 4; } public function init() { $this->test($this->y); } } $a = new Foo(); $a->init(); var_dump($a);

preferences:
30.61 ms | 404 KiB | 5 Q