3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop = 0; public function &getPropRef () { return (int)$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:
174.74 ms | 1430 KiB | 8 Q