3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function add($a, $b) { return $a + $b; } var_dump( add("1" + 1));
based on sDufY
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function add(), 1 passed in /in/Vgo2j on line 5 and exactly 2 expected in /in/Vgo2j:2 Stack trace: #0 /in/Vgo2j(5): add(2) #1 {main} thrown in /in/Vgo2j on line 2
Process exited with code 255.
Output for 5.1.0 - 7.0.20
Warning: Missing argument 2 for add(), called in /in/Vgo2j on line 5 and defined in /in/Vgo2j on line 2 Notice: Undefined variable: b in /in/Vgo2j on line 3 int(2)
Output for 4.3.0 - 5.0.5
Warning: Missing argument 2 for add() in /in/Vgo2j on line 2 int(2)