3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { function __construct() { echo 'hi'; } } //$obj = new ReflectionFunction('phpinfo'); //var_dump(serialize($obj)); $str = 'O:18:"ReflectionFunction":1:{s:4:"info";a:14:{s:4:"name";s:7:"phpinfo";s:7:"closure";s:0:"";s:8:"internal";b:1;s:11:"return_type";b:0;s:3:"doc";b:0;s:6:"params";a:1:{i:0;a:9:{s:5:"index";i:0;s:4:"name";s:4:"what";s:4:"type";s:0:"";s:9:"type_hint";s:0:"";s:8:"function";s:7:"phpinfo";s:8:"nullable";b:1;s:7:"default";i:0;s:11:"defaultText";s:1:"0";s:10:"attributes";a:0:{}}}s:16:"static_variables";a:0:{}s:10:"attributes";a:0:{}s:8:"is_async";b:0;s:10:"is_closure";b:0;s:12:"is_generator";b:0;s:4:"file";s:2:"//";s:5:"line1";i:0;s:5:"line2";i:0;}}'; var_dump(unserialize($str));
based on LT5Ov
Output for 5.0.3 - 7.1.0
object(ReflectionFunction)#1 (2) { ["name"]=> string(0) "" ["info"]=> array(14) { ["name"]=> string(7) "phpinfo" ["closure"]=> string(0) "" ["internal"]=> bool(true) ["return_type"]=> bool(false) ["doc"]=> bool(false) ["params"]=> array(1) { [0]=> array(9) { ["index"]=> int(0) ["name"]=> string(4) "what" ["type"]=> string(0) "" ["type_hint"]=> string(0) "" ["function"]=> string(7) "phpinfo" ["nullable"]=> bool(true) ["default"]=> int(0) ["defaultText"]=> string(1) "0" ["attributes"]=> array(0) { } } } ["static_variables"]=> array(0) { } ["attributes"]=> array(0) { } ["is_async"]=> bool(false) ["is_closure"]=> bool(false) ["is_generator"]=> bool(false) ["file"]=> string(2) "//" ["line1"]=> int(0) ["line2"]=> int(0) } }
Output for 5.0.0 - 5.0.2
object(ReflectionFunction)#1 (1) { ["info"]=> array(14) { ["name"]=> string(7) "phpinfo" ["closure"]=> string(0) "" ["internal"]=> bool(true) ["return_type"]=> bool(false) ["doc"]=> bool(false) ["params"]=> array(1) { [0]=> array(9) { ["index"]=> int(0) ["name"]=> string(4) "what" ["type"]=> string(0) "" ["type_hint"]=> string(0) "" ["function"]=> string(7) "phpinfo" ["nullable"]=> bool(true) ["default"]=> int(0) ["defaultText"]=> string(1) "0" ["attributes"]=> array(0) { } } } ["static_variables"]=> array(0) { } ["attributes"]=> array(0) { } ["is_async"]=> bool(false) ["is_closure"]=> bool(false) ["is_generator"]=> bool(false) ["file"]=> string(2) "//" ["line1"]=> int(0) ["line2"]=> int(0) } }
Output for 4.3.0 - 4.4.9
object(__PHP_Incomplete_Class)(2) { ["__PHP_Incomplete_Class_Name"]=> string(18) "reflectionfunction" ["info"]=> array(14) { ["name"]=> string(7) "phpinfo" ["closure"]=> string(0) "" ["internal"]=> bool(true) ["return_type"]=> bool(false) ["doc"]=> bool(false) ["params"]=> array(1) { [0]=> array(9) { ["index"]=> int(0) ["name"]=> string(4) "what" ["type"]=> string(0) "" ["type_hint"]=> string(0) "" ["function"]=> string(7) "phpinfo" ["nullable"]=> bool(true) ["default"]=> int(0) ["defaultText"]=> string(1) "0" ["attributes"]=> array(0) { } } } ["static_variables"]=> array(0) { } ["attributes"]=> array(0) { } ["is_async"]=> bool(false) ["is_closure"]=> bool(false) ["is_generator"]=> bool(false) ["file"]=> string(2) "//" ["line1"]=> int(0) ["line2"]=> int(0) } }