3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['0' => 1, '1' => 2, '2' => 3]; $b = ['0' => 4, '1' => 5, '2' => 6]; $newArray = array_map('combine',array_map(null, $a, $b)); function combine($n){ return array_combine(array('a','b'),$n); } print_r($newArray);

preferences:
45.36 ms | 406 KiB | 5 Q