Historical ResultsBased on (6) saved test runs, The test labeled "preg_match()" was (on average) the faster by 0.0069 seconds, (0.980% faster)
The preg_match() test took 0.6937 seconds.
The strpos() test took 0.7005 seconds.
Each test case ran 20 random code order iterations consisting of 178,992 loops for a total of 3,579,843 runs.
- Line execution difference (0.000002) milliseconds.
- Avg difference (0.000) milliseconds per 178,992 loops.
- Total difference 6.86 milliseconds for 3,579,843 loops
The iteration variablity for Code 1 was (0.0000) milliseconds and Code 2 was (0.0000) 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;