3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ ['A', 'B', 'C'], ['F', 'G'] ]; $arr2 = [ ['D', 'E'], ['H', 'I', 'J', 'L'] ]; foreach ($arr1 as $i => &$row) { array_push($row, ...$arr2[$i]); } var_export($arr1);

preferences:
37.98 ms | 405 KiB | 5 Q