3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function load(string $file, array $data) {} } $reflection = new \ReflectionClass('Foo'); $method = $reflection->getMethod('load'); var_dump($method->getParameters());
based on ZAMoL
Output for 7.0.0 - 7.3.0rc6
array(2) { [0]=> object(ReflectionParameter)#3 (1) { ["name"]=> string(4) "file" } [1]=> object(ReflectionParameter)#4 (1) { ["name"]=> string(4) "data" } }
Output for hhvm-3.15.4
array(2) { [0]=> object(ReflectionParameter)#3 (3) { ["info"]=> array(10) { ["index"]=> int(0) ["name"]=> string(4) "file" ["type"]=> string(9) "HH\string" ["type_hint"]=> string(6) "string" ["type_hint_builtin"]=> bool(true) ["function"]=> string(4) "load" ["class"]=> string(3) "Foo" ["type_hint_nullable"]=> bool(false) ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(4) "file" ["paramTypeInfo"]=> array(3) { ["name"]=> string(6) "string" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } [1]=> object(ReflectionParameter)#4 (3) { ["info"]=> array(10) { ["index"]=> int(1) ["name"]=> string(4) "data" ["type"]=> string(5) "array" ["type_hint"]=> string(5) "array" ["type_hint_builtin"]=> bool(true) ["function"]=> string(4) "load" ["class"]=> string(3) "Foo" ["type_hint_nullable"]=> bool(false) ["attributes"]=> array(0) { } ["is_optional"]=> bool(false) } ["name"]=> string(4) "data" ["paramTypeInfo"]=> array(3) { ["name"]=> string(5) "array" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } } }
Output for 5.6.0 - 5.6.30
array(2) { [0]=> &object(ReflectionParameter)#3 (1) { ["name"]=> string(4) "file" } [1]=> &object(ReflectionParameter)#4 (1) { ["name"]=> string(4) "data" } }