Result: DiscardedThe test labeled "variables" was the faster by 0.0156 seconds, (1.474% faster)
The variables test took 1.0414 seconds.
The constants test took 1.057 seconds.
Each test case ran 20 random code order iterations consisting of 283,255 loops for a total of 5,665,100 runs.
- Line execution difference (0.000003) milliseconds.
- Avg difference (0.779) milliseconds per 283,255 loops.
- Total difference 15.59 milliseconds for 5,665,100 loops
The iteration variablity for Code 1 was (1.6947) milliseconds and Code 2 was (0.6934) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "constants", was:
define('CONSTANT' . $GLOBALS['i'], $GLOBALS['x'] . $GLOBALS['y'] . $GLOBALS['z']); $GLOBALS['i']++;
The second test, "variables", was:
$GLOBALS['CONSTANT' . $GLOBALS['i']] = $GLOBALS['x'] . $GLOBALS['y'] . $GLOBALS['z']; $GLOBALS['i']++;