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], ]; var_export( array_map( function($row) { array_pop($row); $row[] = array_product($row); return $row; }, $array ) );
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
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:
65.77 ms | 1014 KiB | 4 Q