Result: DiscardedThe test labeled "constants" was the faster by 0.0286 seconds, (2.379% faster)
The constants test took 1.1724 seconds.
The variables test took 1.2009 seconds.
Each test case ran 20 random code order iterations consisting of 278,506 loops for a total of 5,570,120 runs.
- Line execution difference (0.000005) milliseconds.
- Avg difference (1.428) milliseconds per 278,506 loops.
- Total difference 28.57 milliseconds for 5,570,120 loops
The iteration variablity for Code 1 was (8.2482) milliseconds and Code 2 was (7.4043) 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']++;