3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $r = new ReflectionFunction('trim'); var_dump($r->getParameters());
Output for 7.0.0 - 7.1.0
array(2) { [0]=> object(ReflectionParameter)#2 (1) { ["name"]=> string(3) "str" } [1]=> object(ReflectionParameter)#3 (1) { ["name"]=> string(14) "character_mask" } }
Output for hhvm-3.12.0
array(2) { [0]=> object(ReflectionParameter)#2 (3) { ["info"]=> array(9) { ["index"]=> int(0) ["name"]=> string(3) "str" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["type_hint_builtin"]=> bool(true) ["function"]=> string(4) "trim" ["type_hint_nullable"]=> bool(false) ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(3) "str" ["paramTypeInfo"]=> array(3) { ["name"]=> string(9) "HH\string" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } [1]=> object(ReflectionParameter)#3 (3) { ["info"]=> array(11) { ["index"]=> int(1) ["name"]=> string(8) "charlist" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["type_hint_builtin"]=> bool(true) ["function"]=> string(4) "trim" ["type_hint_nullable"]=> bool(false) ["default"]=> string(6) " " ["defaultText"]=> string(18) "HPHP_TRIM_CHARLIST" ["attributes"]=> array(0) { } ["is_optional"]=> bool(true) } ["name"]=> string(8) "charlist" ["paramTypeInfo"]=> array(3) { ["name"]=> string(9) "HH\string" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } }
Output for hhvm-3.10.0
array(2) { [0]=> object(ReflectionParameter)#2 (2) { ["info"]=> array(7) { ["index"]=> int(0) ["name"]=> string(3) "str" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["function"]=> string(4) "trim" ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(3) "str" } [1]=> object(ReflectionParameter)#3 (2) { ["info"]=> array(9) { ["index"]=> int(1) ["name"]=> string(8) "charlist" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["function"]=> string(4) "trim" ["default"]=> string(6) " " ["defaultText"]=> string(18) "HPHP_TRIM_CHARLIST" ["attributes"]=> array(0) { } ["is_optional"]=> bool(true) } ["name"]=> string(8) "charlist" } }
Output for 5.2.0 - 5.6.28
array(2) { [0]=> &object(ReflectionParameter)#2 (1) { ["name"]=> string(3) "str" } [1]=> &object(ReflectionParameter)#3 (1) { ["name"]=> string(14) "character_mask" } }
Output for 5.0.0 - 5.1.6
array(0) { }
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/YHfTo on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/YHfTo on line 2