Result: DiscardedThe test labeled "no cast" was the faster by 0.0924 seconds, (7.878% faster)
The no cast test took 1.0805 seconds.
The (string) test took 1.1729 seconds.
Each test case ran 20 random code order iterations consisting of 284,311 loops for a total of 5,686,220 runs.
- Line execution difference (0.000016) milliseconds.
- Avg difference (4.620) milliseconds per 284,311 loops.
- Total difference 92.40 milliseconds for 5,686,220 loops
The iteration variablity for Code 1 was (6.3900) milliseconds and Code 2 was (1.8042) 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!';