3v4l.org

run code in 300+ PHP versions simultaneously
<?php $GLOBALS['bar'] = 5; function &getSpecialValue() { return $GLOBALS['bar']; } class Foo { public $value = 3; function &getValue() { return $this->value; } function test() { $params = array(); $params[] = &$this->getValue(); $params[] = $this->getValue(); $params[] = getSpecialValue(); return $params; } } $foo = new Foo(); var_dump($foo->test());

preferences:
32.23 ms | 402 KiB | 5 Q