3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function my_func(int $n) { var_dump($n); } my_func('6'); // => (int) 6 my_func(3.1415); // => (int) 3 my_func(TRUE); // => (int) 3
Output for hhvm-3.15.4, 7.0.0 - 7.2.6
int(6) int(3) int(1)
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to my_func() must be an instance of int, string given, called in /in/fQr8U on line 4 and defined in /in/fQr8U on line 2
Process exited with code 255.