3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $foo = 5; function getCallable() { return function() { return $this->foo; }; } } $test = new Test(); $callable = $test->getCallable(); echo "Result is ".$callable(); exit(0);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
208.16 ms | 2979 KiB | 8 Q