3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump((new ReflectionClass('PDO'))->getMethod('prepare')->getParameters());
based on JbRPr
Output for 7.0.0 - 7.1.0
array(2) { [0]=> object(ReflectionParameter)#1 (1) { ["name"]=> string(9) "statement" } [1]=> object(ReflectionParameter)#3 (1) { ["name"]=> string(7) "options" } }
Output for hhvm-3.12.0
array(2) { [0]=> object(ReflectionParameter)#3 (3) { ["info"]=> array(10) { ["index"]=> int(0) ["name"]=> string(9) "statement" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["type_hint_builtin"]=> bool(true) ["function"]=> string(7) "prepare" ["class"]=> string(3) "PDO" ["type_hint_nullable"]=> bool(false) ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(9) "statement" ["paramTypeInfo"]=> array(3) { ["name"]=> string(9) "HH\string" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } [1]=> object(ReflectionParameter)#4 (3) { ["info"]=> array(12) { ["index"]=> int(1) ["name"]=> string(7) "options" ["type"]=> string(5) "array" ["type_hint"]=> string(5) "array" ["type_hint_builtin"]=> bool(true) ["function"]=> string(7) "prepare" ["class"]=> string(3) "PDO" ["type_hint_nullable"]=> bool(false) ["default"]=> array(0) { } ["defaultText"]=> string(9) "array ( )" ["attributes"]=> array(0) { } ["is_optional"]=> bool(true) } ["name"]=> string(7) "options" ["paramTypeInfo"]=> array(3) { ["name"]=> string(5) "array" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } }
Output for hhvm-3.10.0
array(2) { [0]=> object(ReflectionParameter)#3 (2) { ["info"]=> array(8) { ["index"]=> int(0) ["name"]=> string(9) "statement" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(9) "HH\string" ["function"]=> string(7) "prepare" ["class"]=> string(3) "PDO" ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(9) "statement" } [1]=> object(ReflectionParameter)#4 (2) { ["info"]=> array(10) { ["index"]=> int(1) ["name"]=> string(7) "options" ["type"]=> string(5) "array" ["type_hint"]=> string(5) "array" ["function"]=> string(7) "prepare" ["class"]=> string(3) "PDO" ["default"]=> array(0) { } ["defaultText"]=> string(9) "array ( )" ["attributes"]=> array(0) { } ["is_optional"]=> bool(true) } ["name"]=> string(7) "options" } }
Output for 5.4.0 - 5.6.28
array(2) { [0]=> &object(ReflectionParameter)#1 (1) { ["name"]=> string(9) "statement" } [1]=> &object(ReflectionParameter)#3 (1) { ["name"]=> string(7) "options" } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/vJh7Z on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/vJh7Z on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/vJh7Z on line 3
Process exited with code 255.