Result: DiscardedThe test labeled "!defined()" was the faster by 0.0096 seconds, (0.885% faster)
The !defined() test took 1.0751 seconds.
The @define() test took 1.0847 seconds.
Each test case ran 20 random code order iterations consisting of 284,022 loops for a total of 5,680,440 runs.
- Line execution difference (0.000002) milliseconds.
- Avg difference (0.480) milliseconds per 284,022 loops.
- Total difference 9.59 milliseconds for 5,680,440 loops
The iteration variablity for Code 1 was (2.0811) milliseconds and Code 2 was (1.8971) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "@define()", was:
The second test, "!defined()", was:
if (!defined('CONSTANT')) define('CONSTANT', $GLOBALS['dummy']);