3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function arraysSum(array $arrays): array { return array_map(function(array $array): int { return array_sum($array); }, $arrays); } print_r(arraysSum([1,2,3], [4,5,6], [7,8,9]));
based on vni1l
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be of the type array, integer given in /in/IV8qs:4 Stack trace: #0 [internal function]: {closure}(1) #1 /in/IV8qs(6): array_map(Object(Closure), Array) #2 /in/IV8qs(9): arraysSum(Array, Array, Array) #3 {main} thrown in /in/IV8qs on line 4
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/IV8qs on line 2
Process exited with code 255.