3v4l.org

run code in 300+ PHP versions simultaneously
<?php function inspect($object, $property) { return (function () use ($property) { return $this->$property; })->call($object); } class Foo { private $bar = "hands off!"; } var_dump(inspect(new Foo(), "bar"));

preferences:
55.38 ms | 402 KiB | 5 Q