3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $originalArray = [ ['A', 'B', 'C'], [1,2,3], [4,5,6], ]; $headers = array_shift($myArray); array_walk( $myArray, function($row) use ($headers) { $row = array_combine($headers, $row); } ); var_dump($myArray);
Output for 7.0.0 - 7.2.0
Warning: array_shift() expects parameter 1 to be array, null given in /in/79iGn on line 9 Warning: array_walk() expects parameter 1 to be array, null given in /in/79iGn on line 14 NULL
Output for 5.4.9 - 5.6.28
Warning: array_shift() expects parameter 1 to be array, null given in /in/79iGn on line 9 Warning: array_walk() expects parameter 1 to be array, null given in /in/79iGn on line 15 NULL
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/79iGn on line 3
Process exited with code 255.