3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldArray = array( array("country", "state", "city", "name"), array("Argentina", "Corrientes", "Corrientes", "Jorge"), array("Argentina", "Chaco", "Resistencia", "Mariano") ); $arr[] = array_shift($oldArray); $new_arr = array_map('array_combine',$arr,$oldArray); print_r($new_arr);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: array_combine(): Argument #1 ($keys) must be of type array, null given in /in/enHuk:9 Stack trace: #0 [internal function]: array_combine(NULL, Array) #1 /in/enHuk(9): array_map('array_combine', Array, Array) #2 {main} thrown in /in/enHuk on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: array_combine() expects parameter 1 to be array, null given in /in/enHuk on line 9 Array ( [0] => Array ( [country] => Argentina [state] => Corrientes [city] => Corrientes [name] => Jorge ) [1] => )

preferences:
167.89 ms | 403 KiB | 197 Q