3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Some { public function method(int $int) { } } $function = new ReflectionMethod('Some', 'method'); foreach ($function->getParameters() as $parameter) { var_dump($parameter->isCallable(), $parameter->getType()); }
based on Z2Vdf
Output for 7.1.0 - 7.2.0
bool(false) object(ReflectionNamedType)#3 (0) { }
Output for 7.0.0 - 7.0.20
bool(false) object(ReflectionType)#3 (0) { }
Output for hhvm-3.13.2 - 3.17.3
bool(false) object(ReflectionType)#3 (1) { ["type_hint_info":"ReflectionType":private]=> array(3) { ["name"]=> string(3) "int" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } }
Output for hhvm-3.11.1 - 3.12.14
bool(false) object(ReflectionType)#3 (1) { ["type_hint_info":"ReflectionType":private]=> array(3) { ["name"]=> string(6) "HH\int" ["nullable"]=> bool(false) ["builtin"]=> bool(true) } }
Output for 5.4.0 - 5.6.30, hhvm-3.10.1
Fatal error: Call to undefined method ReflectionParameter::getType() in /in/XUtMu on line 19
Process exited with code 255.