3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reg_exUrl = "/((http|https)\:\/\/|(www)\.)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; $text = 'some text www.google.bg/'; preg_match_all($reg_exUrl, $text, $matches); $usedPatterns = array(); foreach($matches[0] as $pattern){ if(!array_key_exists($pattern, $usedPatterns)) { $usedPatterns[$pattern] = true; if(!preg_match('%https://%',$pattern) && !preg_match('%http://%',$pattern)) { $start = "http://"; } if(strlen($pattern) > 18) { $pattern_short = substr($pattern, 0, 10).substr($pattern, -7); } $text = str_replace($pattern, "<a href='".(isset($start) ? $start : '')."{$pattern}' target='_blank'>".(isset($pattern_short) ? $pattern_short : $pattern."</a> ", $text); } } echo $text;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.280.2330.04318.95
5.4.270.2370.04019.13
5.4.260.2100.04019.11
5.4.250.2130.03719.21
5.4.240.2200.03719.25
5.4.230.2530.03319.30
5.4.220.2670.04719.08
5.4.210.2470.03719.13
5.4.200.2800.04319.09
5.4.190.2470.04019.21
5.4.180.2300.04319.30
5.4.170.2370.04319.20
5.4.160.2900.04319.22
5.4.150.2700.04318.83
5.4.140.2770.03316.39
5.4.130.2830.03316.34
5.4.120.2630.03316.38
5.4.110.2300.04316.46
5.4.100.2330.04016.45
5.4.90.2330.04016.25
5.4.80.2100.04016.18
5.4.70.2630.03316.57
5.4.60.2100.03316.43
5.4.50.2370.03716.38
5.4.40.2200.04016.53
5.4.30.2630.03316.42
5.4.20.2330.03316.51
5.4.10.2300.03716.51
5.4.00.2130.03715.83
5.3.280.2530.03714.46
5.3.270.2170.04014.50
5.3.260.2730.03714.55
5.3.250.2270.04014.45
5.3.240.2130.03714.55
5.3.230.2730.03314.45
5.3.220.2100.04014.43
5.3.210.2170.04014.67
5.3.200.2200.03314.51
5.3.190.2130.03714.52
5.3.180.2270.03714.61
5.3.170.2170.03314.52
5.3.160.2170.03314.42
5.3.150.2130.04014.58
5.3.140.2130.03714.43
5.3.130.2200.03014.49
5.3.120.2100.04014.38
5.3.110.2170.04014.45
5.3.100.2270.03013.98
5.3.90.2600.04014.04
5.3.80.2270.04013.87
5.3.70.2470.03713.80
5.3.60.2600.02713.96
5.3.50.2330.04013.82
5.3.40.2170.03713.90
5.3.30.2530.03713.75
5.3.20.2300.03313.79
5.3.10.2070.03313.44
5.3.00.2430.03313.52

preferences:
135.37 ms | 1398 KiB | 7 Q