3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v_4 = [ [1, 2, 3], [4, 5, 6], ]; $v_5 = [ [7, 8, 9], [10, 11, 12], ]; foreach ($v_4 as $i => &$row) { foreach ($row as $k => &$v) { $v += $v_5[$i][$k]; } } var_export($v_4);

preferences:
25.51 ms | 404 KiB | 5 Q