3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'baz'; } function reader ($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);
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '&' in /in/IIM26 on line 12
Process exited with code 255.

preferences:
176.25 ms | 1395 KiB | 53 Q