3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function formatUrlsInText($text){ $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; preg_match_all($reg_exUrl, $text, $matches); $usedPatterns = array(); foreach($matches[0] as $pattern){ if(!array_key_exists($pattern, $usedPatterns)){ $usedPatterns[$pattern]=true; $text = str_replace ($pattern, "<a href="{$pattern}" rel="nofollow">{$pattern}</a> ", $text); } } return $text; } $str = 'Hi bro! Look at my new website: www.example.com. I leard to build websites from http://another.example.net and from example.net.'; $newStr = formatUrlsInText($str); echo $newStr;

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.270.0060.05012.36
5.4.260.0100.03612.36
5.4.250.0090.03712.36
5.4.240.0110.04612.36
5.4.230.0150.04912.35
5.4.220.0170.05912.35
5.4.210.0080.03912.36
5.4.200.0050.04112.35
5.4.190.0070.03612.35
5.4.180.0050.04112.35
5.4.170.0110.05012.36
5.4.160.0100.04412.35
5.4.150.0050.05012.35
5.4.140.0060.03912.04
5.4.130.0060.03712.02
5.4.120.0070.04611.98
5.4.110.0080.03411.98
5.4.100.0060.03711.98
5.4.90.0040.04311.98
5.4.80.0090.04711.98
5.4.70.0020.04011.98
5.4.60.0010.04211.98
5.4.50.0070.03811.98
5.4.40.0070.04211.96
5.4.30.0060.03611.96
5.4.20.0050.04111.95
5.4.10.0090.03311.96
5.4.00.0040.04711.45
5.3.280.0060.03912.71
5.3.270.0090.03612.72
5.3.260.0090.03912.72
5.3.250.0090.04012.71
5.3.240.0110.04212.72
5.3.230.0120.04412.71
5.3.220.0060.04512.68
5.3.210.0040.04112.68
5.3.200.0080.03512.68
5.3.190.0040.03912.68
5.3.180.0060.03612.68
5.3.170.0060.03612.67
5.3.160.0090.03612.68
5.3.150.0100.03312.67
5.3.140.0070.03612.66
5.3.130.0040.04212.66
5.3.120.0060.03812.66
5.3.110.0060.03912.66
5.3.100.0100.03512.11
5.3.90.0070.04312.08
5.3.80.0090.03612.08
5.3.70.0080.03412.08
5.3.60.0090.03212.07
5.3.50.0040.03912.00
5.3.40.0060.03912.00
5.3.30.0110.03211.94
5.3.20.0070.03611.70
5.3.10.0070.03511.66
5.3.00.0080.03511.64

preferences:
140.42 ms | 1394 KiB | 7 Q