3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i < 1000000; $i++) { preg_match('/^(http|https)?:?\/\//', 'https://stackoverflow.com/questions/20248666/in-this-case-which-is-better-in-matching-regular-expression-or-parse-url'); } echo number_format(microtime(true) - $time, 10), "\n"; $time = microtime(true); for ($i = 0; $i < 1000000; $i++) { strpos('https://stackoverflow.com/questions/20248666/in-this-case-which-is-better-in-matching-regular-expression-or-parse-url', 'https://') === 0 || strpos('https://stackoverflow.com/questions/20248666/in-this-case-which-is-better-in-matching-regular-expression-or-parse-url', 'http://') === 0 || strpos('https://stackoverflow.com/questions/20248666/in-this-case-which-is-better-in-matching-regular-expression-or-parse-url', '//'); } echo number_format(microtime(true) - $time, 10);
Output for git.master_jit
0.0650901794 0.0258619785
Output for git.master
0.0612790585 0.0246019363
Output for rfc.property-hooks
0.0810019970 0.0234711170

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
32.13 ms | 407 KiB | 5 Q