- var_dump: documentation ( source)
- microtime: documentation ( source)
- join: documentation ( source)
<?php
$html = '';
$len = 100;
$start = microtime(true);
for ($i = 0; $i < $len; $i++) {
$html .= 'a';
}
var_dump(microtime(true) - $start);
$html = '';
$start = microtime(true);
$tmp = array();
for ($i = 0; $i < $len; $i++) {
$tmp[] = 'a';
}
$html = join('', $tmp);
var_dump(microtime(true) - $start);