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:
147.07 ms | 1426 KiB | 8 Q