3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(int $a) { return $a * 2; } var_dump(foo('123'));
Output for 7.0.28 - 7.3.0rc3
int(246)
Output for 5.6.38
Catchable fatal error: Argument 1 passed to foo() must be an instance of int, string given, called in /in/TJQJX on line 7 and defined in /in/TJQJX on line 3
Process exited with code 255.