Result: DiscardedThe test labeled "sprintf()" was the faster by 0.0095 seconds, (0.954% faster)
The sprintf() test took 0.99 seconds.
The commas test took 0.9995 seconds.
Each test case ran 20 random code order iterations consisting of 159,206 loops for a total of 3,184,120 runs.
- Line execution difference (0.000003) milliseconds.
- Avg difference (0.477) milliseconds per 159,206 loops.
- Total difference 9.54 milliseconds for 3,184,120 loops
The iteration variablity for Code 1 was (8.4803) milliseconds and Code 2 was (6.8923) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "commas", was:
echo $GLOBALS['x'], ' test ', $GLOBALS['y'], $GLOBALS['z'], ' test ';
The second test, "sprintf()", was:
echo sprintf('%s test %s%s test ', $GLOBALS['x'], $GLOBALS['y'], $GLOBALS['z']);