3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function b() {} } $r = new ReflectionMethod(new a, "b"); var_dump($r->getParameters()); $s = serialize($r); var_dump($s); $r = unserialize($s); var_dump($r->getParameters());
Output for 7.1.0 - 7.2.0
array(0) { } string(67) "O:16:"ReflectionMethod":2:{s:4:"name";s:1:"b";s:5:"class";s:1:"a";}" Fatal error: Uncaught Error: Internal error: Failed to retrieve the reflection object in /in/G2I4A:15 Stack trace: #0 /in/G2I4A(15): ReflectionFunctionAbstract->getParameters() #1 {main} thrown in /in/G2I4A on line 15
Process exited with code 255.
Output for 5.3.3 - 7.0.20
array(0) { } string(67) "O:16:"ReflectionMethod":2:{s:4:"name";s:1:"b";s:5:"class";s:1:"a";}" Fatal error: ReflectionFunctionAbstract::getParameters(): Internal error: Failed to retrieve the reflection object in /in/G2I4A on line 15
Process exited with code 255.
Output for 5.0.3 - 5.3.2
array(0) { } string(67) "O:16:"ReflectionMethod":2:{s:4:"name";s:1:"b";s:5:"class";s:1:"a";}" Fatal error: Internal error: Failed to retrieve the reflection object in /in/G2I4A on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.2
array(0) { } string(67) "O:16:"ReflectionMethod":2:{s:5:"class";s:1:"a";s:4:"name";s:1:"b";}" Fatal error: Internal error: Failed to retrieve the reflection object in /in/G2I4A on line 15
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionmethod in /in/G2I4A on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionmethod in /in/G2I4A on line 7