3v4l.org

run code in 150+ 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
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 - 5.6.28, 7.0.0 - 7.0.14
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 hhvm-3.10.0 - 3.12.0
array(0) { } Warning: Attempted to serialize unserializable builtin class ReflectionMethod in /in/G2I4A on line 10 string(2) "N;" Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getParameters() on a non-object (null)' in /in/G2I4A:15 Stack trace: #0 {main}
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