Test0: 0.03959 sec / 100000 Loops Test1: 0.03563 sec / 100000 Loops Test2: 0.03019 sec / 100000 Loops Test3: 0.03081 sec / 100000 Loops Test4: 0.00231 sec / 1000 Loops Test5: 0.00168 sec / 1000 Loops Test6: 0.00163 sec / 1000 Loops Test7: 0.00161 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");