- round: documentation ( source)
- array_merge: documentation ( source)
- memory_get_usage: documentation ( source)
- array_fill: documentation ( source)
<?php
$start = memory_get_usage();
$names = array_fill(0, 1000, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
echo "10k values in a 1000x10 matrix: ", round((memory_get_usage()-$start)/1024),"KB\n";
$names = array_merge(...$names);
echo "Same 10k values in a plain vector: ", round((memory_get_usage()-$start)/1024),"KB\n";