3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function addArrays() { return array_sum(func_get_args()); } $output = array(0,0,0,0,0); $testdata = "580,680,480,380"; $input = explode(",", $testdata); $subTotal = array_sum(explode(",", $testdata)); array_push($input,$subTotal); $output = array_map(addArrays(), $output, $input); var_dump(output); ?>
based on PgniU
Output for 7.2.0
Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in /in/AMbL0 on line 12 Warning: Use of undefined constant output - assumed 'output' (this will throw an Error in a future version of PHP) in /in/AMbL0 on line 13 string(6) "output"
Output for 5.3.18 - 7.1.10
Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in /in/AMbL0 on line 12 Notice: Use of undefined constant output - assumed 'output' in /in/AMbL0 on line 13 string(6) "output"