3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new ReflectionFunction('phpinfo'); $obj = $obj->getClosure(); var_dump($obj);
based on jRmit
Output for 5.4.35 - 5.6.28, 7.0.0 - 7.1.0
object(Closure)#2 (0) { }
Output for hhvm-3.12.0
object(Closure$ReflectionFunction::getClosure;520589053)#2 (2) { ["parameter"]=> array(1) { ["$args"]=> string(10) "<required>" } ["this"]=> object(ReflectionFunction)#1 (3) { ["name"]=> string(7) "phpinfo" ["closure":"ReflectionFunction":private]=> NULL ["params":"ReflectionFunctionAbstract":private]=> NULL } }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.34
object(Closure)#2 (1) { ["parameter"]=> array(1) { ["$what"]=> string(10) "<optional>" } }
Output for 5.0.0 - 5.3.29
Fatal error: Call to undefined method ReflectionFunction::getClosure() in /in/ZtjUJ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/ZtjUJ on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/ZtjUJ on line 2