Benchmark One - High

4.48800283 - 4000 cycles

Benchmark Two - High

3.24294379 - 4000 cycles

Benchmark One - Low

5.17224769 - 4000 cycles

Benchmark Two - Low

4.31859057 - 4000 cycles

Current Benchmark

<?php 

$find 
'syridium';
$replace 'ME!';
$string $str;
echo 
strtr($string, array($find => $replace));

 
?>
vs.
<?php 

$find 
'syridium';
$replace 'ME!';
$string $str;
echo 
str_replace($find$replace$string);

 
?>

Conclusion

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

<?php 

$find 
'syridium';
$replace 'ME!';
$string $str;
echo 
str_replace($find$replace$string);

 
?>


Copyright Syridium DV