3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function () { echo 'hello world'; }; function closure_dump($closure) { try{ $func = new ReflectionFunction($closure); } catch (ReflectionException $e) { echo $e->getMessage(); return; } $start = $func->getStartLine() - 1; $end = $func->getEndLine() - 1; $filename = $func->getFileName(); echo implode("", array_slice(file($filename),$start, $end - $start + 1)); } closure_dump($test);

preferences:
38.27 ms | 402 KiB | 5 Q