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); }
based on cQIZM
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6
object(ReflectionFunction)#2 (1) { ["name"]=> string(9) "{closure}" }
Output for hhvm-3.15.4
object(ReflectionFunction)#2 (3) { ["name"]=> string(9) "{closure}" ["closure":"ReflectionFunction":private]=> object(Closure$;1932546505$f68320803da18c0d893895bfa78128c$)#1 (1) { ["static"]=> array(1) { ["var"]=> string(4) "test" } } ["params":"ReflectionFunctionAbstract":private]=> NULL }