3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'baz'; } class Qwe extends Foo { public function qwerty() { $reader = function & ($object, $property) { $value = & Closure::bind(function & () use ($property) { return $this->$property; }, $object, $object)->__invoke(); return $value; }; $bar = & $reader($this, 'bar'); var_dump($bar); } } $q = new Qwe(); $q->qwerty();

preferences:
39.52 ms | 402 KiB | 5 Q