3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_2 = []; for($i=1;$i<=1000;++$i){ $temp = []; for($j=1;$j<=1000;++$j){ $temp[] = rand(1,100); } $array_2[] = $temp; } echo array_sum(array_reduce($array_2, 'array_merge', []));

preferences:
34.24 ms | 406 KiB | 5 Q