3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(bool $in) { return $in ? 3 : 5; } $inParam = (new ReflectionParameter('foo', 'in')); $result = foo(TRUE); echo "Param: ", $inParam, PHP_EOL, "Type: ", $inParam->getType();
based on Iq9AP
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
Catchable fatal error: Argument 1 passed to foo() must be an instance of bool, boolean given, called in /in/XnUD5 on line 8 and defined in /in/XnUD5 on line 3
Process exited with code 255.