Test: === null vs. == null
No Description
View test history (1) Run this test again Return to test menuResult: Discarded
The test labeled "=== null" was the faster by 0.0334 seconds, (6.341% faster)
The === null test took 0.4934 seconds.
The == null test took 0.5268 seconds.
Nitty-Gritty
Each test case ran 20 random code order iterations consisting of 132,710 loops for a total of 2,654,200 runs.
- Line execution difference (0.000013) milliseconds.
- Avg difference (1.670) milliseconds per 132,710 loops.
- Total difference 33.40 milliseconds for 2,654,200 loops
The iteration variablity for Code 1 was (2.4087) milliseconds and Code 2 was (3.1354) milliseconds. The lower and the closer together there values are the more accurate the results are.
Code
The first test, "=== null", was:
for ($j = 0; $j < 100; $j++) { $GLOBALS['dummy3'] = $GLOBALS['dummy1'] === null; $GLOBALS['dummy3'] += $GLOBALS['dummy2'] === null; }
The second test, "== null", was:
for ($j = 0; $j < 100; $j++) { $GLOBALS['dummy3'] = $GLOBALS['dummy1'] == null; $GLOBALS['dummy3'] += $GLOBALS['dummy2'] == null; }