Benchmark One - High

1.3865191199999 - 8000 cycles

Benchmark Two - High

1.10882631 - 8000 cycles

Benchmark One - Low

1.2920103 - 8000 cycles

Benchmark Two - Low

1.2480432 - 8000 cycles

Current Benchmark

<?php 

echo str_replace(
    
'Hi',
    
'Hello',
    
str_replace(
        
' u',
        
' you',
        
str_replace(
            
'r',
            
'are',
            
str_replace(
                
'2',
                
'too',
                
str_replace(
                    
'gud',
                    
'good',
                    
str_replace(
                        
'Wut',
                        
'What',
                        
str_replace(
                            
'bout',
                            
'about',
                            
str_replace(
                                
'I\'m',
                                
'I am',
                                
str_replace(
                                    
'2day',
                                    
'today',
                                    
'Hi, Jim, how r u 2day?
                                    I\'m gud Bob! Wut bout u?
                                    I\'m gud 2!'
                                
)
                            )
                        )
                    )
                )
            )
        )
    )
);

 
?>
vs.
<?php 

echo str_replace(
    array (
        
'Hi',
        
'r',
        
' u',
        
'2day',
        
'I\'m',
        
'gud',
        
'Wut',
        
'bout',
        
'2',
    ),
    array (
        
'Hello',
        
'are',
        
' you',
        
'today',
        
'I am',
        
'good',
        
'What',
        
'about',
        
'too',
    ),
    
'Hi, Jim, how r u 2day?
    I\'m gud Bob! Wut bout u?
    I\'m gud 2!'
);

 
?>

Conclusion

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

<?php 

echo str_replace(
    array (
        
'Hi',
        
'r',
        
' u',
        
'2day',
        
'I\'m',
        
'gud',
        
'Wut',
        
'bout',
        
'2',
    ),
    array (
        
'Hello',
        
'are',
        
' you',
        
'today',
        
'I am',
        
'good',
        
'What',
        
'about',
        
'too',
    ),
    
'Hi, Jim, how r u 2day?
    I\'m gud Bob! Wut bout u?
    I\'m gud 2!'
);

 
?>


Copyright Syridium DV