3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FooInterface { public function get(); } class Foo implements FooInterface { protected $thing = 5; public function &get() { return $this->thing; } } $foo = new Foo(); $thing = &$foo->get(); $thing = 7; var_dump($foo->get());

preferences:
36.08 ms | 402 KiB | 5 Q