3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(int $foo, int $bar) { var_dump($foo, $bar); } foo(123, 123); foo('foo', 'bar'); var_dump((int) 'foo');
based on PZqqC
Output for 7.0.0 - 7.2.0
int(123) int(123) Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, string given, called in /in/59c7R on line 9 and defined in /in/59c7R:3 Stack trace: #0 /in/59c7R(9): foo('foo', 'bar') #1 {main} thrown in /in/59c7R on line 3
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be an instance of int, integer given, called in /in/59c7R on line 8 and defined in /in/59c7R on line 3
Process exited with code 255.