Test0: 0.02823 sec / 100000 Loops Test1: 0.02710 sec / 100000 Loops Test2: 0.02231 sec / 100000 Loops Test3: 0.02379 sec / 100000 Loops Test4: 0.00213 sec / 1000 Loops Test5: 0.00170 sec / 1000 Loops Test6: 0.00164 sec / 1000 Loops Test7: 0.00159 sec / 1000 Loops ---------- <xmp><?php $funcs = array( function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html .= '<a href="' . $href . '">' . $text . '</a><br>'; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html .= "<a href=\"" . $href . "\">" . $text . "</a><br>"; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html .= "<a href=\"$href\">$text</a><br>"; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html .= "<a href=\"{$href}\">{$text}</a><br>"; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html = $html . '<a href="' . $href . '">' . $text . '</a><br>'; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html = $html . "<a href=\"" . $href . "\">" . $text . "</a><br>"; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html = "$html<a href=\"$href\">$text</a><br>"; } return $html; }, function($html, $href, $text, $loopmax) { for($i=0; $i<$loopmax; $i++) { $html = "{$html}<a href=\"{$href}\">{$text}</a><br>"; } return $html; }, ); for($i=0; $i<count($funcs); $i++) { $func = $funcs[$i]; $max = $i > 3 ? 1000 : 100000; $start_time = microtime(true); $html = ""; $html = $func($html, "http://gomiba.co.in/", "my web page here", $max); $end_time = microtime(true); echo "Test{$i}: " . sprintf("%.5f", ($end_time - $start_time)) . " sec / " . sprintf("%6d", $max) . " Loops\n"; } echo "----------\n"; echo file_get_contents("string_concat.php");