3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [1, 2, 3, 4]; $callable = function($value, $key, array $output) { $output[$key] = $value * 100; }; $output = []; array_map($callable, $array, array_keys($array), $output); print_r($output);
based on p3e4M
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 3 passed to {closure}() must be of the type array, null given in /in/lA6ns:4 Stack trace: #0 [internal function]: {closure}(1, 0, NULL) #1 /in/lA6ns(9): array_map(Object(Closure), Array, Array, Array) #2 {main} thrown in /in/lA6ns on line 4
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Catchable fatal error: Argument 3 passed to {closure}() must be of the type array, null given in /in/lA6ns on line 4
Process exited with code 255.