Historical ResultsBased on (1) saved test runs, The test labeled "str_ireplace" was (on average) the faster by 0.0117 seconds, (1.022% faster)
The str_ireplace test took 1.1339 seconds.
The str_replace/strtolower test took 1.1457 seconds.
Each test case ran 20 random code order iterations consisting of 281,025 loops for a total of 5,620,500 runs.
- Line execution difference (0.000002) milliseconds.
- Avg difference (0.000) milliseconds per 281,025 loops.
- Total difference 11.71 milliseconds for 5,620,500 loops
The iteration variablity for Code 1 was (0.0000) milliseconds and Code 2 was (0.0000) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "str_ireplace", was:
str_ireplace('sTrIng', 'STRING!', $GLOBALS['dummy']);
The second test, "str_replace/strtolower", was:
str_replace('string', 'STRING!', strtolower($GLOBALS['dummy']));