3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new ReflectionMethod('ReflectionFunction','invoke'); $a->invoke('phpinfo');
based on 0mhUk
Output for 7.1.0
Warning: ReflectionMethod::invoke() expects parameter 1 to be object, string given in /in/1LWNt on line 4
Output for 7.0.0 - 7.0.14
Fatal error: Uncaught ReflectionException: Non-object passed to Invoke() in /in/1LWNt:4 Stack trace: #0 /in/1LWNt(4): ReflectionMethod->invoke('phpinfo') #1 {main} thrown in /in/1LWNt on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
Warning: hphp_invoke_method() expects parameter 1 to be object, string given in /in/1LWNt on line 4
Output for 5.0.3 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Non-object passed to Invoke()' in /in/1LWNt:4 Stack trace: #0 /in/1LWNt(4): ReflectionMethod->invoke('phpinfo') #1 {main} thrown in /in/1LWNt on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'ReflectionException' with message 'Non-object passed to Invoke()' in /in/1LWNt:4 Stack trace: #0 {main} thrown in /in/1LWNt on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionmethod in /in/1LWNt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionmethod in /in/1LWNt on line 3