3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function starts_with_strpos($haystack, $needle) { return strpos($haystack, $needle) === 0; } function starts_with_substr($haystack, $needle) { return substr($haystack, 0, strlen($needle)) === $needle; } // setup the haystack and needle $haystack = "Hello PHP"; $needle = "Hello"; // initialize the results array $results = array('substr' => array(), 'strpos' => array()); // Run the substr benchmark // exhaust the gc's threshhold at 10K $it = 10000; for($i = 0; $i < $it; $i++) { $t = microtime(true); starts_with_substr($haystack, $needle); $results['substr'][] = microtime(true) - $t; } // discard the first and last results as opline biased array_pop($results['substr']); array_shift($results['substr']); // Run the strpos benchmark for($i = 0; $i < $it; $i++) { $t = microtime(true); starts_with_strpos($haystack, $needle); $results['strpos'][] = microtime(true) - $t; } // discard the first and last results as opline biased array_pop($results['strpos']); array_shift($results['strpos']); // compare the results $a = array_sum($results['substr']) / $it; $b = array_sum($results['strpos']) / $it; printf("substr: %.9fs/iteration @ %d iterations\nstrpos: %.9fs/iteration @ %d iterations\n\n", $a, $it, $b, $it); // determine which is faster (substr or strpos) if ($a > $b) { // substr is slower printf("strpos is %d%% faster than substr\n", $b / $a * 100); } elseif ($b > $a) { // strpos is slower printf("substr is %d%% faster than strpos\n", $a / $b * 100); } else { // they're the same printf("strpos and substr are the same\n"); }
Output for 7.1.0
substr: 0.000000240s/iteration @ 10000 iterations strpos: 0.000000235s/iteration @ 10000 iterations strpos is 97% faster than substr
Output for 7.0.14
substr: 0.000000301s/iteration @ 10000 iterations strpos: 0.000000262s/iteration @ 10000 iterations strpos is 87% faster than substr
Output for 7.0.6
substr: 0.000000214s/iteration @ 10000 iterations strpos: 0.000000174s/iteration @ 10000 iterations strpos is 81% faster than substr
Output for 7.0.5
substr: 0.000000202s/iteration @ 10000 iterations strpos: 0.000000166s/iteration @ 10000 iterations strpos is 81% faster than substr
Output for 7.0.4
substr: 0.000000128s/iteration @ 10000 iterations strpos: 0.000000109s/iteration @ 10000 iterations strpos is 84% faster than substr
Output for 7.0.3
substr: 0.000000130s/iteration @ 10000 iterations strpos: 0.000000118s/iteration @ 10000 iterations strpos is 91% faster than substr
Output for 7.0.2
substr: 0.000000132s/iteration @ 10000 iterations strpos: 0.000000113s/iteration @ 10000 iterations strpos is 85% faster than substr
Output for 7.0.1
substr: 0.000000194s/iteration @ 10000 iterations strpos: 0.000000165s/iteration @ 10000 iterations strpos is 85% faster than substr
Output for 7.0.0
substr: 0.000000211s/iteration @ 10000 iterations strpos: 0.000000176s/iteration @ 10000 iterations strpos is 83% faster than substr
Output for hhvm-3.12.0
substr: 0.000000306s/iteration @ 10000 iterations strpos: 0.000000250s/iteration @ 10000 iterations strpos is 81% faster than substr
Output for hhvm-3.10.0
substr: 0.000000383s/iteration @ 10000 iterations strpos: 0.000000323s/iteration @ 10000 iterations strpos is 84% faster than substr
Output for 5.6.28
substr: 0.000000706s/iteration @ 10000 iterations strpos: 0.000000499s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.6.21
substr: 0.000000512s/iteration @ 10000 iterations strpos: 0.000000341s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.6.20
substr: 0.000000467s/iteration @ 10000 iterations strpos: 0.000000350s/iteration @ 10000 iterations strpos is 74% faster than substr
Output for 5.6.19
substr: 0.000000380s/iteration @ 10000 iterations strpos: 0.000000266s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.6.18
substr: 0.000000371s/iteration @ 10000 iterations strpos: 0.000000259s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.6.17
substr: 0.000000476s/iteration @ 10000 iterations strpos: 0.000000327s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.6.16
substr: 0.000000708s/iteration @ 10000 iterations strpos: 0.000000316s/iteration @ 10000 iterations strpos is 44% faster than substr
Output for 5.6.15
substr: 0.000000775s/iteration @ 10000 iterations strpos: 0.000000402s/iteration @ 10000 iterations strpos is 51% faster than substr
Output for 5.6.14
substr: 0.000000562s/iteration @ 10000 iterations strpos: 0.000000381s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.6.13
substr: 0.000000606s/iteration @ 10000 iterations strpos: 0.000000402s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.6.12
substr: 0.000000574s/iteration @ 10000 iterations strpos: 0.000000398s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.6.11
substr: 0.000000412s/iteration @ 10000 iterations strpos: 0.000000284s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.6.10
substr: 0.000000453s/iteration @ 10000 iterations strpos: 0.000000318s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.6.9
substr: 0.000000425s/iteration @ 10000 iterations strpos: 0.000000288s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.6.8
substr: 0.000000372s/iteration @ 10000 iterations strpos: 0.000000254s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.6.7
substr: 0.000000587s/iteration @ 10000 iterations strpos: 0.000000382s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.5.35
substr: 0.000000620s/iteration @ 10000 iterations strpos: 0.000000418s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.5.34
substr: 0.000000607s/iteration @ 10000 iterations strpos: 0.000000396s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.5.33
substr: 0.000000468s/iteration @ 10000 iterations strpos: 0.000000314s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.5.32
substr: 0.000000536s/iteration @ 10000 iterations strpos: 0.000000357s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.5.31
substr: 0.000000493s/iteration @ 10000 iterations strpos: 0.000000338s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.5.30
substr: 0.000000406s/iteration @ 10000 iterations strpos: 0.000000289s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.5.29
substr: 0.000000564s/iteration @ 10000 iterations strpos: 0.000000366s/iteration @ 10000 iterations strpos is 64% faster than substr
Output for 5.5.28
substr: 0.000000607s/iteration @ 10000 iterations strpos: 0.000000411s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.5.27
substr: 0.000000477s/iteration @ 10000 iterations strpos: 0.000000331s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.5.26
substr: 0.000000573s/iteration @ 10000 iterations strpos: 0.000000381s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.5.25
substr: 0.000000546s/iteration @ 10000 iterations strpos: 0.000000368s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.5.24
substr: 0.000000676s/iteration @ 10000 iterations strpos: 0.000000441s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.4.45
substr: 0.000000381s/iteration @ 10000 iterations strpos: 0.000000298s/iteration @ 10000 iterations strpos is 78% faster than substr
Output for 5.4.44
substr: 0.000000506s/iteration @ 10000 iterations strpos: 0.000000324s/iteration @ 10000 iterations strpos is 64% faster than substr
Output for 5.4.43
substr: 0.000000373s/iteration @ 10000 iterations strpos: 0.000000275s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 5.4.42
substr: 0.000000381s/iteration @ 10000 iterations strpos: 0.000000259s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.41
substr: 0.000000369s/iteration @ 10000 iterations strpos: 0.000000289s/iteration @ 10000 iterations strpos is 78% faster than substr
Output for 5.4.40
substr: 0.000000373s/iteration @ 10000 iterations strpos: 0.000000283s/iteration @ 10000 iterations strpos is 76% faster than substr
Output for 5.4.39
substr: 0.000000582s/iteration @ 10000 iterations strpos: 0.000000392s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.38
substr: 0.000000592s/iteration @ 10000 iterations strpos: 0.000000304s/iteration @ 10000 iterations strpos is 51% faster than substr
Output for 5.4.37
substr: 0.000000576s/iteration @ 10000 iterations strpos: 0.000000378s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.4.36
substr: 0.000000614s/iteration @ 10000 iterations strpos: 0.000000417s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.35
substr: 0.000000574s/iteration @ 10000 iterations strpos: 0.000000390s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.34
substr: 0.000000610s/iteration @ 10000 iterations strpos: 0.000000405s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.17, 5.4.32
substr: 0.000000577s/iteration @ 10000 iterations strpos: 0.000000390s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.31
substr: 0.000000461s/iteration @ 10000 iterations strpos: 0.000000550s/iteration @ 10000 iterations substr is 83% faster than strpos
Output for 5.4.30
substr: 0.000000541s/iteration @ 10000 iterations strpos: 0.000000307s/iteration @ 10000 iterations strpos is 56% faster than substr
Output for 5.4.29
substr: 0.000000434s/iteration @ 10000 iterations strpos: 0.000000309s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.4.28
substr: 0.000000579s/iteration @ 10000 iterations strpos: 0.000000388s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.27
substr: 0.000000390s/iteration @ 10000 iterations strpos: 0.000000274s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.4.26
substr: 0.000000543s/iteration @ 10000 iterations strpos: 0.000000359s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.25
substr: 0.000000599s/iteration @ 10000 iterations strpos: 0.000000407s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.24
substr: 0.000000586s/iteration @ 10000 iterations strpos: 0.000000393s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.23
substr: 0.000000577s/iteration @ 10000 iterations strpos: 0.000000389s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.22
substr: 0.000000385s/iteration @ 10000 iterations strpos: 0.000000272s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.4.21
substr: 0.000000568s/iteration @ 10000 iterations strpos: 0.000000385s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.20
substr: 0.000000522s/iteration @ 10000 iterations strpos: 0.000000398s/iteration @ 10000 iterations strpos is 76% faster than substr
Output for 5.4.19
substr: 0.000000580s/iteration @ 10000 iterations strpos: 0.000000384s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.18
substr: 0.000000567s/iteration @ 10000 iterations strpos: 0.000000375s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.16
substr: 0.000000442s/iteration @ 10000 iterations strpos: 0.000000304s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.4.15
substr: 0.000000630s/iteration @ 10000 iterations strpos: 0.000000410s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.4.14
substr: 0.000000447s/iteration @ 10000 iterations strpos: 0.000000295s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.4.13
substr: 0.000000599s/iteration @ 10000 iterations strpos: 0.000000420s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.4.12
substr: 0.000000601s/iteration @ 10000 iterations strpos: 0.000000401s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.11
substr: 0.000000593s/iteration @ 10000 iterations strpos: 0.000000391s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.4.10
substr: 0.000000503s/iteration @ 10000 iterations strpos: 0.000000359s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.4.9
substr: 0.000000417s/iteration @ 10000 iterations strpos: 0.000000275s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.4.8
substr: 0.000000395s/iteration @ 10000 iterations strpos: 0.000000275s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.4.7
substr: 0.000000450s/iteration @ 10000 iterations strpos: 0.000000306s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.4.6
substr: 0.000000389s/iteration @ 10000 iterations strpos: 0.000000265s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.4.5
substr: 0.000000388s/iteration @ 10000 iterations strpos: 0.000000272s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.4.4
substr: 0.000000440s/iteration @ 10000 iterations strpos: 0.000000301s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.4.3
substr: 0.000000592s/iteration @ 10000 iterations strpos: 0.000000401s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.2
substr: 0.000000451s/iteration @ 10000 iterations strpos: 0.000000318s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.4.1
substr: 0.000000600s/iteration @ 10000 iterations strpos: 0.000000403s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.4.0
substr: 0.000000687s/iteration @ 10000 iterations strpos: 0.000000393s/iteration @ 10000 iterations strpos is 57% faster than substr
Output for 5.3.29
substr: 0.000000699s/iteration @ 10000 iterations strpos: 0.000000465s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.3.28
substr: 0.000000679s/iteration @ 10000 iterations strpos: 0.000000469s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.3.27
substr: 0.000000624s/iteration @ 10000 iterations strpos: 0.000000421s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.3.26
substr: 0.000000662s/iteration @ 10000 iterations strpos: 0.000000450s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.3.25
substr: 0.000000649s/iteration @ 10000 iterations strpos: 0.000000446s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.24
substr: 0.000000496s/iteration @ 10000 iterations strpos: 0.000000341s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.23
substr: 0.000000714s/iteration @ 10000 iterations strpos: 0.000000471s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.3.22
substr: 0.000000456s/iteration @ 10000 iterations strpos: 0.000000328s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.3.21
substr: 0.000000461s/iteration @ 10000 iterations strpos: 0.000000326s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.3.20
substr: 0.000000672s/iteration @ 10000 iterations strpos: 0.000000469s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.3.19
substr: 0.000000756s/iteration @ 10000 iterations strpos: 0.000000536s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.3.18
substr: 0.000000557s/iteration @ 10000 iterations strpos: 0.000000384s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.17
substr: 0.000000729s/iteration @ 10000 iterations strpos: 0.000000475s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.3.16
substr: 0.000000724s/iteration @ 10000 iterations strpos: 0.000000462s/iteration @ 10000 iterations strpos is 63% faster than substr
Output for 5.3.15
substr: 0.000000473s/iteration @ 10000 iterations strpos: 0.000000324s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.14
substr: 0.000000528s/iteration @ 10000 iterations strpos: 0.000000372s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.3.13
substr: 0.000000637s/iteration @ 10000 iterations strpos: 0.000000426s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.3.12
substr: 0.000000697s/iteration @ 10000 iterations strpos: 0.000000466s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.3.11
substr: 0.000000803s/iteration @ 10000 iterations strpos: 0.000000570s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.3.10
substr: 0.000000635s/iteration @ 10000 iterations strpos: 0.000000422s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.3.9
substr: 0.000000646s/iteration @ 10000 iterations strpos: 0.000000449s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.3.8
substr: 0.000000523s/iteration @ 10000 iterations strpos: 0.000000340s/iteration @ 10000 iterations strpos is 64% faster than substr
Output for 5.3.7
substr: 0.000000555s/iteration @ 10000 iterations strpos: 0.000000369s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 5.3.6
substr: 0.000000731s/iteration @ 10000 iterations strpos: 0.000000482s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.3.5
substr: 0.000000528s/iteration @ 10000 iterations strpos: 0.000000361s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.4
substr: 0.000000720s/iteration @ 10000 iterations strpos: 0.000000495s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.3
substr: 0.000000619s/iteration @ 10000 iterations strpos: 0.000000426s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.3.2
substr: 0.000000642s/iteration @ 10000 iterations strpos: 0.000000422s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 5.3.1
substr: 0.000000707s/iteration @ 10000 iterations strpos: 0.000000474s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.3.0
substr: 0.000000650s/iteration @ 10000 iterations strpos: 0.000000466s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.2.17
substr: 0.000000801s/iteration @ 10000 iterations strpos: 0.000000613s/iteration @ 10000 iterations strpos is 76% faster than substr
Output for 5.2.16
substr: 0.000000890s/iteration @ 10000 iterations strpos: 0.000000631s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.2.15
substr: 0.000000842s/iteration @ 10000 iterations strpos: 0.000000612s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 5.2.14
substr: 0.000000856s/iteration @ 10000 iterations strpos: 0.000000617s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 5.2.13
substr: 0.000000760s/iteration @ 10000 iterations strpos: 0.000000559s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 5.2.12
substr: 0.000000897s/iteration @ 10000 iterations strpos: 0.000000635s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.2.11
substr: 0.000000806s/iteration @ 10000 iterations strpos: 0.000000547s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.2.10
substr: 0.000000866s/iteration @ 10000 iterations strpos: 0.000000620s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.2.9
substr: 0.000000875s/iteration @ 10000 iterations strpos: 0.000000608s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.2.8
substr: 0.000000765s/iteration @ 10000 iterations strpos: 0.000000473s/iteration @ 10000 iterations strpos is 61% faster than substr
Output for 5.2.7
substr: 0.000000897s/iteration @ 10000 iterations strpos: 0.000000661s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 5.2.6
substr: 0.000000713s/iteration @ 10000 iterations strpos: 0.000000557s/iteration @ 10000 iterations strpos is 78% faster than substr
Output for 5.2.5
substr: 0.000000882s/iteration @ 10000 iterations strpos: 0.000000649s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 5.2.4
substr: 0.000000758s/iteration @ 10000 iterations strpos: 0.000000565s/iteration @ 10000 iterations strpos is 74% faster than substr
Output for 5.2.3
substr: 0.000000845s/iteration @ 10000 iterations strpos: 0.000000591s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 5.2.2
substr: 0.000000762s/iteration @ 10000 iterations strpos: 0.000000545s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.2.1
substr: 0.000000954s/iteration @ 10000 iterations strpos: 0.000000717s/iteration @ 10000 iterations strpos is 75% faster than substr
Output for 5.2.0
substr: 0.000000955s/iteration @ 10000 iterations strpos: 0.000000655s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 5.1.6
substr: 0.000000787s/iteration @ 10000 iterations strpos: 0.000000573s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 5.1.5
substr: 0.000000676s/iteration @ 10000 iterations strpos: 0.000000479s/iteration @ 10000 iterations strpos is 70% faster than substr
Output for 5.1.4
substr: 0.000000606s/iteration @ 10000 iterations strpos: 0.000000524s/iteration @ 10000 iterations strpos is 86% faster than substr
Output for 5.1.3
substr: 0.000000709s/iteration @ 10000 iterations strpos: 0.000000511s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 5.1.2
substr: 0.000000728s/iteration @ 10000 iterations strpos: 0.000000605s/iteration @ 10000 iterations strpos is 83% faster than substr
Output for 5.1.1
substr: 0.000000922s/iteration @ 10000 iterations strpos: 0.000000699s/iteration @ 10000 iterations strpos is 75% faster than substr
Output for 5.1.0
substr: 0.000000791s/iteration @ 10000 iterations strpos: 0.000000582s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 5.0.5
substr: 0.000001431s/iteration @ 10000 iterations strpos: 0.000000964s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 5.0.4
substr: 0.000001259s/iteration @ 10000 iterations strpos: 0.000000933s/iteration @ 10000 iterations strpos is 74% faster than substr
Output for 5.0.3
substr: 0.000000950s/iteration @ 10000 iterations strpos: 0.000000721s/iteration @ 10000 iterations strpos is 75% faster than substr
Output for 5.0.2
substr: 0.000001275s/iteration @ 10000 iterations strpos: 0.000000910s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 5.0.1
substr: 0.000001253s/iteration @ 10000 iterations strpos: 0.000000910s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 5.0.0
substr: 0.000001071s/iteration @ 10000 iterations strpos: 0.000000731s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 4.4.9
substr: 0.000001798s/iteration @ 10000 iterations strpos: 0.000001293s/iteration @ 10000 iterations strpos is 71% faster than substr
Output for 4.4.8
substr: 0.000002100s/iteration @ 10000 iterations strpos: 0.000001466s/iteration @ 10000 iterations strpos is 69% faster than substr
Output for 4.4.7
substr: 0.000001868s/iteration @ 10000 iterations strpos: 0.000001242s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 4.4.6
substr: 0.000001394s/iteration @ 10000 iterations strpos: -0.000098964s/iteration @ 10000 iterations strpos is -7098% faster than substr
Output for 4.4.5
substr: 0.000001912s/iteration @ 10000 iterations strpos: 0.000001314s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 4.4.4
substr: 0.000001771s/iteration @ 10000 iterations strpos: 0.000001198s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 4.4.3
substr: 0.000001708s/iteration @ 10000 iterations strpos: 0.000001137s/iteration @ 10000 iterations strpos is 66% faster than substr
Output for 4.4.2
substr: 0.000001863s/iteration @ 10000 iterations strpos: 0.000001192s/iteration @ 10000 iterations strpos is 64% faster than substr
Output for 4.4.1
substr: 0.000001596s/iteration @ 10000 iterations strpos: 0.000001085s/iteration @ 10000 iterations strpos is 67% faster than substr
Output for 4.4.0
substr: 0.000001539s/iteration @ 10000 iterations strpos: 0.000001135s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 4.3.11
substr: 0.000001912s/iteration @ 10000 iterations strpos: 0.000001242s/iteration @ 10000 iterations strpos is 64% faster than substr
Output for 4.3.10
substr: 0.000001393s/iteration @ 10000 iterations strpos: 0.000001162s/iteration @ 10000 iterations strpos is 83% faster than substr
Output for 4.3.9
substr: 0.000001233s/iteration @ 10000 iterations strpos: 0.000001073s/iteration @ 10000 iterations strpos is 86% faster than substr
Output for 4.3.8
substr: 0.000001850s/iteration @ 10000 iterations strpos: 0.000001416s/iteration @ 10000 iterations strpos is 76% faster than substr
Output for 4.3.7
substr: 0.000002288s/iteration @ 10000 iterations strpos: 0.000001566s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 4.3.6
substr: 0.000001934s/iteration @ 10000 iterations strpos: 0.000001416s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 4.3.5
substr: 0.000001765s/iteration @ 10000 iterations strpos: 0.000001364s/iteration @ 10000 iterations strpos is 77% faster than substr
Output for 4.3.4
substr: 0.000001876s/iteration @ 10000 iterations strpos: 0.000001372s/iteration @ 10000 iterations strpos is 73% faster than substr
Output for 4.3.3
substr: 0.000002280s/iteration @ 10000 iterations strpos: 0.000001569s/iteration @ 10000 iterations strpos is 68% faster than substr
Output for 4.3.2
substr: 0.000002017s/iteration @ 10000 iterations strpos: 0.000001466s/iteration @ 10000 iterations strpos is 72% faster than substr
Output for 4.3.1
substr: 0.000001913s/iteration @ 10000 iterations strpos: 0.000001245s/iteration @ 10000 iterations strpos is 65% faster than substr
Output for 4.3.0
substr: 0.000002070s/iteration @ 10000 iterations strpos: 0.000001480s/iteration @ 10000 iterations strpos is 71% faster than substr