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:
77.11 ms | 404 KiB | 5 Q