3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function add(int $a, int $b) { return $a + $b; } echo add(1, "string");
based on YaIoW
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 2 passed to add() must be of the type integer, string given, called in /in/Dmk2V on line 5 and defined in /in/Dmk2V:2 Stack trace: #0 /in/Dmk2V(5): add(1, 'string') #1 {main} thrown in /in/Dmk2V on line 2
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to add() must be an instance of int, integer given, called in /in/Dmk2V on line 5 and defined in /in/Dmk2V on line 2
Process exited with code 255.