3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $value = 3; function &getValue() { return &$this->value; } function test() { $params = array(); $params[] = &$this->getValue(); $params[] = $this->getValue(); return $params; } } $foo = new Foo(); var_dump($foo->test());
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '&' in /in/nosG9 on line 9
Process exited with code 255.

preferences:
184.11 ms | 1395 KiB | 62 Q