3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text ="I found some really good articles on such and such topic. Here are a few links to check out: http://www.example.com/hOSDHOUA and https://www.mywebsite.com/h/yIFeelLowIfImHigh and http://example-site.com/today-is-a-beautiful-day/. "; $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // The Text you want to filter for urls // Check if there is a url in the text if(preg_match_all($reg_exUrl, $text, $url)) { foreach($url[0] as $link){ $text = str_replace($link, "<a href={$link}>{$link}</a> ", $text); // <--- Part in question } echo $text; } else { // if no urls in the text just return the 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)
8.3.60.0090.00620.16
8.3.50.0100.01018.23
8.3.40.0130.00619.10
8.3.30.0110.00418.86
8.3.20.0000.00821.90
8.3.10.0000.00723.62
8.3.00.0000.00821.86
8.2.180.0150.00318.79
8.2.170.0070.00722.96
8.2.160.0070.00719.16
8.2.150.0070.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00018.21
8.2.120.0040.00426.35
8.2.110.0030.00619.27
8.2.100.0060.00618.16
8.2.90.0080.00018.09
8.2.80.0090.00019.14
8.2.70.0050.00318.00
8.2.60.0080.00017.75
8.2.50.0000.00818.05
8.2.40.0080.00018.05
8.2.30.0040.00419.50
8.2.20.0060.00318.17
8.2.10.0040.00420.55
8.2.00.0050.00319.33
8.1.280.0140.00025.92
8.1.270.0040.00418.91
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.19
8.1.230.0080.00422.64
8.1.220.0080.00017.74
8.1.210.0040.00418.89
8.1.200.0080.00017.47
8.1.190.0060.00317.48
8.1.180.0040.00418.10
8.1.170.0080.00017.62
8.1.160.0050.00218.90
8.1.150.0030.00518.93
8.1.140.0000.00822.25
8.1.130.0040.00420.12
8.1.120.0000.00717.57
8.1.110.0000.01017.59
8.1.100.0070.00017.65
8.1.90.0040.00417.61
8.1.80.0060.00317.60
8.1.70.0030.00317.60
8.1.60.0090.00017.77
8.1.50.0000.00817.78
8.1.40.0000.00717.61
8.1.30.0000.00817.86
8.1.20.0040.00417.80
8.1.10.0000.00817.80
8.1.00.0030.00617.68
8.0.300.0040.00420.25
8.0.290.0040.00416.88
8.0.280.0030.00318.51
8.0.270.0070.00017.37
8.0.260.0030.00318.37
8.0.250.0030.00317.01
8.0.240.0000.00817.02
8.0.230.0000.00817.06
8.0.220.0030.00317.09
8.0.210.0070.00017.07
8.0.200.0000.00817.14
8.0.190.0070.00017.16
8.0.180.0040.00417.04
8.0.170.0040.00417.00
8.0.160.0040.00416.96
8.0.150.0000.01116.93
8.0.140.0040.00417.05
8.0.130.0000.00613.49
8.0.120.0080.00017.08
8.0.110.0000.00717.13
8.0.100.0070.00016.97
8.0.90.0050.00317.04
8.0.80.0060.01417.01
8.0.70.0030.00717.13
8.0.60.0000.00716.89
8.0.50.0050.00317.05
8.0.30.0110.00917.39
8.0.20.0120.01517.38
8.0.10.0000.00817.23
8.0.00.0090.00916.95
7.4.330.0000.00516.80
7.4.320.0060.00316.76
7.4.300.0040.00416.82
7.4.290.0070.00016.83
7.4.280.0050.00216.82
7.4.270.0000.00916.80
7.4.260.0050.00316.80
7.4.250.0000.00816.79
7.4.240.0000.00816.80
7.4.230.0000.00816.54
7.4.220.0000.00816.80
7.4.210.0120.00716.78
7.4.200.0030.00316.72
7.4.160.0150.01416.71
7.4.140.0100.00917.86
7.4.130.0130.01316.93
7.4.120.0070.01016.69
7.4.110.0090.00916.77
7.4.100.0140.00616.60
7.4.90.0000.01816.75
7.4.80.0080.01619.39
7.4.70.0060.01216.82
7.4.60.0130.00316.61
7.4.50.0040.01116.66
7.4.40.0040.01216.43
7.4.00.0070.01115.11
7.3.330.0000.00513.40
7.3.320.0030.00313.22
7.3.310.0000.00716.46
7.3.300.0050.00316.45
7.3.290.0070.00016.49
7.3.280.0100.00716.50
7.3.260.0120.00716.63
7.3.240.0110.00616.62
7.3.230.0060.01116.78
7.3.210.0090.01116.45
7.3.200.0070.01016.48
7.3.190.0120.00916.90
7.3.180.0130.00316.47
7.3.170.0160.00616.84
7.3.160.0050.01316.65
7.3.00.3100.01014.70
7.2.330.0100.00716.86
7.2.320.0100.01016.99
7.2.310.0060.01116.88
7.2.300.0030.01416.78
7.2.290.0150.00916.89
7.2.130.2120.00715.21
7.2.120.0350.00615.18
7.2.110.0150.00914.95
7.2.100.0220.00515.02
7.2.90.3670.00715.05
7.2.80.4360.01015.07
7.2.70.3480.00015.23
7.2.60.3290.01615.28
7.2.50.0110.01115.29
7.2.40.0480.01115.11
7.2.30.0090.00915.25
7.2.20.0410.00315.10
7.2.10.0590.01115.00
7.2.00.1730.01315.26
7.1.250.0190.01013.97
7.0.330.0100.01013.90
5.6.380.0100.00514.05

preferences:
63.95 ms | 400 KiB | 5 Q