3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(bool $in) { return $in; } $inParam = (new ReflectionParameter('foo', 'in')); echo "Param: ", $inParam, PHP_EOL, "Type: ", $inParam->getType();
based on qdupZ
Output for 7.0.0 - 7.2.6
Param: Parameter #0 [ <required> boolean $in ] Type: bool
Output for hhvm-3.15.4
Param: Parameter #0 [ <required> bool $in ] Type: bool
Output for 5.6.0 - 5.6.30
Param: Parameter #0 [ <required> bool $in ] Type: Fatal error: Call to undefined method ReflectionParameter::getType() in /in/Iq9AP on line 8
Process exited with code 255.