3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reducea($a1,$b1){ return $a1+$b1; } $arr =array("2","3","4"); $c = reducea($arr); print_r($c);
based on 0ZtR5
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function reducea(), 1 passed in /in/313FV on line 6 and exactly 2 expected in /in/313FV:2 Stack trace: #0 /in/313FV(6): reducea(Array) #1 {main} thrown in /in/313FV on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Warning: Missing argument 2 for reducea(), called in /in/313FV on line 6 and defined in /in/313FV on line 2 Notice: Undefined variable: b1 in /in/313FV on line 3 Fatal error: Uncaught Error: Unsupported operand types in /in/313FV:3 Stack trace: #0 /in/313FV(6): reducea(Array) #1 {main} thrown in /in/313FV on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
Warning: reducea() expects exactly 2 parameters, 1 given in /in/313FV on line 3 Notice: Undefined variable: b1 in /in/313FV on line 3 Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /in/313FV on line 3
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Warning: Missing argument 2 for reducea(), called in /in/313FV on line 6 and defined in /in/313FV on line 2 Notice: Undefined variable: b1 in /in/313FV on line 3 Fatal error: Unsupported operand types in /in/313FV on line 3
Process exited with code 255.
Output for 4.3.2 - 5.0.5
Warning: Missing argument 2 for reducea() in /in/313FV on line 2 Fatal error: Unsupported operand types in /in/313FV on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Missing argument 2 for reducea() in /in/313FV on line 2 Fatal error: Unsupported operand types in /in/313FV on line 3