Benchmark One - High

5.68979462 - 3000 cycles

Benchmark Two - High

2.75257789 - 3000 cycles

Benchmark One - Low

6.73632135 - 3000 cycles

Benchmark Two - Low

4.40791955 - 3000 cycles

Current Benchmark

<?php 

$find 
= array (
    
'syridium' => 'ME!',
    
'test' => 'yep',
    
'Images' => 'wow',
    
'hello' => 'syridium developments',
);
$string $str;
echo 
strtr($string$find);

 
?>
vs.
<?php 

$find 
= array (
    
'syridium' => 'ME!',
    
'test' => 'yep',
    
'Images' => 'wow',
    
'hello' => 'syridium developments',
);
$string $str;
foreach(
$find as $f => $re)
{
    
$string str_replace($f$re$string);
}
echo 
$string;

 
?>

Conclusion

After an average of 3000 cycles, the fastest option is Benchmark 2!

<?php 

$find 
= array (
    
'syridium' => 'ME!',
    
'test' => 'yep',
    
'Images' => 'wow',
    
'hello' => 'syridium developments',
);
$string $str;
foreach(
$find as $f => $re)
{
    
$string str_replace($f$re$string);
}
echo 
$string;

 
?>


Copyright Syridium DV