3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop = 0; public function &getPropRef () { return $this->prop; } } $obj = new Foo(); $variable = &$obj->getPropRef(); $variable = 1; $variable = 2; $variable = 3; echo $obj->prop;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
151.18 ms | 1490 KiB | 9 Q