3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $ref; public function &getRef() { return & $this->ref; } public function test() { $this->ref = 123; $local = $this->getRef(); $this->ref = 456; echo $local; } } (new Foo)->test();
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Parse error: syntax error, unexpected '&', expecting ';' in /in/5pTS8 on line 10
Process exited with code 255.

preferences:
202.56 ms | 1395 KiB | 71 Q