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"));

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
170.56 ms | 3309 KiB | 10 Q