3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var = 'test'; $func = function()use($var) { echo $var; }; $ref = new ReflectionFunction($func); $functionParameters = []; var_dump($ref); foreach($ref->getParameters() as $key => $currentParameter) { $functionParameters[$currentParameter->getName()] = func_get_arg($key); } var_dump($ref->getParameters());
based on TJJLU
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.1
object(ReflectionFunction)#2 (1) { ["name"]=> string(9) "{closure}" } array(0) { }
Output for hhvm-3.15.4
object(ReflectionFunction)#2 (3) { ["name"]=> string(9) "{closure}" ["closure":"ReflectionFunction":private]=> object(Closure$;366201241$3e1566e139a15048f571f8e9e93babdf$)#1 (1) { ["static"]=> array(1) { ["var"]=> string(4) "test" } } ["params":"ReflectionFunctionAbstract":private]=> NULL } array(0) { }