3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar = 'baz'; public function getBar() { return &$this->bar; } } //$reader = function & ($object, $property) { // $value = & Closure::bind(function & () use ($property) { // return $this->$property; // }, $object, $object)->__invoke(); // // return $value; //}; $foo = new Foo(); //$bar = & $reader($foo, 'bar'); //$bar = 'tab'; //var_dump($foo); echo $foo->getBar();
Output for 5.3.0 - 5.4.17
Parse error: syntax error, unexpected '&' in /in/3ERUg on line 9
Process exited with code 255.