3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call($o, $a, $r, $context) { $ref = new ReflectionFunction($o); return $ref->invokeArgs($a); } class A { protected $a = 5; public function __invoke() { $f = function () { return $this->a; }; return $f(); //eturn call($f, array(), array(), isset($this) ? $this : null); } } $a = new A; var_dump($a());

preferences:
41.41 ms | 402 KiB | 5 Q