3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [4, 3, 5, 7, 210], [4, 9, 5, 7, 210], [4, 9, 25, 7, 210], ]; foreach ($array as &$row) { array_pop($row); $row[] = array_product($row); } var_export($array);
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
array ( 0 => array ( 0 => 4, 1 => 3, 2 => 5, 3 => 7, 4 => 420, ), 1 => array ( 0 => 4, 1 => 9, 2 => 5, 3 => 7, 4 => 1260, ), 2 => array ( 0 => 4, 1 => 9, 2 => 25, 3 => 7, 4 => 6300, ), )

preferences:
77 ms | 402 KiB | 61 Q