Result: DiscardedThe test labeled "strpos()" was the faster by 0.1517 seconds, (11.260% faster)
The strpos() test took 1.1955 seconds.
The preg_match() test took 1.3472 seconds.
Each test case ran 20 random code order iterations consisting of 278,876 loops for a total of 5,577,520 runs.
- Line execution difference (0.000027) milliseconds.
- Avg difference (7.585) milliseconds per 278,876 loops.
- Total difference 151.70 milliseconds for 5,577,520 loops
The iteration variablity for Code 1 was (12.4857) milliseconds and Code 2 was (5.1288) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "preg_match()", was:
if (preg_match('~http://www\.google\.com/~', $GLOBALS['dummy']) != 0) $GLOBALS['dummy2'] = 42;
The second test, "strpos()", was:
if (strpos($GLOBALS['dummy'], 'http://wwww.google.com/') !== false) $GLOBALS['dummy2'] = 42;