3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bar(int $foo, int $bar) { return $foo; } try { bar('I like turtles', 0.42); } catch (TypeError $e) { echo $e->getMessage().PHP_EOL; }
based on aeb3f
Output for 7.0.0 - 7.2.0
Argument 1 passed to bar() must be of the type integer, string given, called in /in/ZAbjS on line 8
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to bar() must be an instance of int, string given, called in /in/ZAbjS on line 8 and defined in /in/ZAbjS on line 3
Process exited with code 255.