Benchmark One - High

2.3945206099999 - 6000 cycles

Benchmark Two - High

3.77646437 - 6000 cycles

Benchmark One - Low

2.8404748699999 - 6000 cycles

Benchmark Two - Low

4.52352452 - 6000 cycles

Current Benchmark

<?php 

$template 
'
<html><head><title>{$title}</title></head><body><?php if(true) { ?>TRUE!<?php } else { ?>FALSE!<?php } ?></body></html>
'
;
$array $array;
$title 'Page Title';
eval(
'echo "'.strtr($template$array).'";');

 
?>
vs.
<?php 

$template 
'
<html><head><title>{$title}</title></head><body><?php if(true) { ?>TRUE!<?php } else { ?>FALSE!<?php } ?></body></html>
'
;
$array $array;
$title 'Page Title';
foreach (
$array as $f => $re)
    
$template str_replace($f$re$template);
eval(
'echo "'.$template.'";');

 
?>

Conclusion

After an average of 6000 cycles, the fastest option is Benchmark 1!

<?php 

$template 
'
<html><head><title>{$title}</title></head><body><?php if(true) { ?>TRUE!<?php } else { ?>FALSE!<?php } ?></body></html>
'
;
$array $array;
$title 'Page Title';
eval(
'echo "'.strtr($template$array).'";');

 
?>


Copyright Syridium DV