3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { function a() { echo 'hi'; } } $class = new ReflectionClass('test'); $method = $class->getMethod('a'); echo serialize($method); echo unserialize('O:16:"ReflectionMethod":2:{s:4:"name";s:1:"a";s:5:"class";s:4:"test";}');
based on 4iKfL
Output for 7.1.0
O:16:"ReflectionMethod":2:{s:4:"name";s:1:"a";s:5:"class";s:4:"test";} Fatal error: Method ReflectionMethod::__toString() must not throw an exception, caught Error: Internal error: Failed to retrieve the reflection object in /in/IImEn on line 0
Process exited with code 255.
Output for 5.3.3 - 7.0.14
O:16:"ReflectionMethod":2:{s:4:"name";s:1:"a";s:5:"class";s:4:"test";} Fatal error: ReflectionMethod::__toString(): Internal error: Failed to retrieve the reflection object in /in/IImEn on line 11
Process exited with code 255.
Output for 5.0.0 - 5.3.2
O:16:"ReflectionMethod":2:{s:4:"name";s:1:"a";s:5:"class";s:4:"test";} Fatal error: Internal error: Failed to retrieve the reflection object in /in/IImEn on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/IImEn on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/IImEn on line 7