<?php
$vars = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
$start = microtime(true);
for($k=0;$k<100;$k++) {
$str = ltrim(strrev(chunk_split(implode(array_reverse($vars)), 3, ';')),';');
}
$end = microtime(true);
echo $end - $start;
echo "\n\n";
$start = microtime(true);
for($k=0;$k<100;$k++) {
$size = sizeOf($vars);
for ($i = $size-3; $i > 0; $i-=3) {
array_splice($vars,$i,0,";");
}
}
$end = microtime(true);
echo $end - $start;
preferences:
33.88 ms | 402 KiB | 5 Q