Result: DiscardedThe test labeled "no cast" was the faster by 0.0094 seconds, (0.926% faster)
The no cast test took 1.0026 seconds.
The (string) test took 1.012 seconds.
Each test case ran 20 random code order iterations consisting of 208,516 loops for a total of 4,170,320 runs.
- Line execution difference (0.000002) milliseconds.
- Avg difference (0.469) milliseconds per 208,516 loops.
- Total difference 9.37 milliseconds for 4,170,320 loops
The iteration variablity for Code 1 was (8.5495) milliseconds and Code 2 was (8.8933) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "(string)", was:
for ($j = 0; $j < 1000; $j++) $GLOBALS['dummy'] = 'good morning! ' . (string) $j . ' good night!';
The second test, "no cast", was:
for ($j = 0; $j < 1000; $j++) $GLOBALS['dummy'] = 'good morning! ' . $j . ' good night!';