3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($url){ $url = str_replace("\\r","\r",$url); $url = str_replace("\\n","\n<BR>",$url); $url = str_replace("\\n\\r","\n\r",$url); $in=array( '`(?:https?|ftp)://\S+[[:alnum:]]/?(?<!\.(png|jpeg|jpg|gif)\b)`si', '`(?<!//)(www\.\S+[[:alnum:]]/?)(?<!\.(png|jpeg|jpg|gif)\b)`si', //'`(?:https?|ftp)://\S+[[:alnum:]]\.(png|jpeg|jpg|gif)\b`si', //'`(?<!//)(?:www\.\S+[[:alnum:]]\.(png|jpeg|jpg|gif)\b)`si' ); // это для ссылок и фото $out=array( '<a style="color:navy;" href="$0" rel="nofollow">$0</a>', '<a style="color:navy;" href="http://$0" rel=\'nofollow\'>$0</a>', //'<img src="$0" rel="nofollow">', //'<img src="http://$0" rel=\'nofollow\'>' ); return preg_replace($in, $out, $url); } echo replace('dfd dfdf http://site.ru/ ddd fff http://img.com/pic.png 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.0100.01018.68
8.3.50.0100.00821.21
8.3.40.0040.01118.70
8.3.30.0070.00719.03
8.3.20.0040.00420.38
8.3.10.0050.00322.09
8.3.00.0050.00322.29
8.2.180.0030.01216.75
8.2.170.0140.00422.96
8.2.160.0100.00319.16
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0090.00019.40
8.2.110.0030.00720.87
8.2.100.0040.00817.85
8.2.90.0040.00418.22
8.2.80.0080.00017.97
8.2.70.0080.00017.75
8.2.60.0060.00318.03
8.2.50.0040.00418.07
8.2.40.0030.00620.01
8.2.30.0000.00718.14
8.2.20.0000.00717.66
8.2.10.0000.00717.66
8.2.00.0080.00017.66
8.1.280.0070.00725.92
8.1.270.0090.00921.97
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0060.00323.97
8.1.230.0070.00420.97
8.1.220.0040.00417.79
8.1.210.0110.00018.77
8.1.200.0060.00317.23
8.1.190.0080.00017.10
8.1.180.0030.00618.54
8.1.170.0040.00418.59
8.1.160.0040.00422.02
8.1.150.0070.00418.62
8.1.140.0000.00817.48
8.1.130.0070.00017.87
8.1.120.0070.00017.39
8.1.110.0000.00817.40
8.1.100.0030.00517.25
8.1.90.0080.00017.43
8.1.80.0000.00717.42
8.1.70.0040.00417.38
8.1.60.0040.00417.60
8.1.50.0060.00317.40
8.1.40.0000.00717.50
8.1.30.0050.00217.51
8.1.20.0040.00417.54
8.1.10.0060.00317.58
8.1.00.0080.00017.43
8.0.300.0000.00720.09
8.0.290.0000.00816.75
8.0.280.0000.00718.45
8.0.270.0030.00517.13
8.0.260.0030.00316.84
8.0.250.0070.00016.90
8.0.240.0030.00616.86
8.0.230.0030.00316.89
8.0.220.0070.00016.96
8.0.210.0030.00316.88
8.0.200.0060.00017.01
8.0.190.0030.00316.86
8.0.180.0000.00816.85
8.0.170.0000.00916.93
8.0.160.0040.00416.87
8.0.150.0070.00016.89
8.0.140.0000.00716.75
8.0.130.0000.00513.33
8.0.120.0040.00416.84
8.0.110.0050.00216.79
8.0.100.0040.00416.91
8.0.90.0080.00016.95
8.0.80.0130.00316.82
8.0.70.0040.00416.76
8.0.60.0050.00316.77
8.0.50.0050.00216.89
8.0.30.0120.00916.96
8.0.20.0110.00717.41
8.0.10.0000.00717.02
8.0.00.0110.00816.82
7.4.330.0030.00315.00
7.4.320.0000.00616.65
7.4.300.0030.00316.64
7.4.290.0000.00716.55
7.4.280.0040.00416.56
7.4.270.0030.00316.47
7.4.260.0000.01116.65
7.4.250.0040.00416.46
7.4.240.0060.00116.64
7.4.230.0040.00416.68
7.4.220.0090.01616.61
7.4.210.0040.01216.61
7.4.200.0030.00316.56
7.4.190.0000.00716.63
7.4.160.0030.01216.71
7.4.150.0030.01417.40
7.4.140.0070.01317.86
7.4.130.0140.00916.74
7.4.120.0130.00416.51
7.4.110.0100.01416.76
7.4.100.0160.00616.62
7.4.90.0110.00716.59
7.4.80.0120.00919.39
7.4.70.0140.00416.39
7.4.60.0100.00616.52
7.4.50.0040.00416.43
7.4.40.0100.00722.77
7.4.30.0150.00316.60
7.4.00.0040.01114.84
7.3.330.0040.00413.25
7.3.320.0000.00513.38
7.3.310.0030.00316.27
7.3.300.0000.00716.24
7.3.290.0120.00316.40
7.3.280.0080.00716.37
7.3.270.0090.00917.40
7.3.260.0150.00616.35
7.3.250.0130.00716.48
7.3.240.0150.00316.37
7.3.230.0170.00716.43
7.3.210.0100.00916.41
7.3.200.0040.01119.39
7.3.190.0070.01016.79
7.3.180.0030.01616.42
7.3.170.0130.01016.37
7.3.160.0060.00916.50
7.3.120.0030.01314.99
7.3.00.0040.00416.79
7.2.330.0170.00316.84
7.2.320.0070.01016.70
7.2.310.0070.01416.74
7.2.300.0070.01116.40
7.2.290.0070.01016.61
7.2.130.0080.00316.76
7.2.120.0040.00916.69
7.2.110.0070.00716.62
7.2.100.0000.01416.88
7.2.90.0080.00416.98
7.2.80.0070.01017.07
7.2.70.0130.00616.95
7.2.60.0100.00316.55
7.2.50.0090.00316.73
7.2.40.0070.00716.91
7.2.30.0060.00616.82
7.2.20.0070.00416.96
7.2.10.0030.00916.94
7.2.00.0030.00818.25
7.1.250.0040.01115.74
7.1.240.0100.00715.71
7.1.230.0150.00015.72
7.1.220.0040.00715.70
7.1.210.0030.01015.64
7.1.200.0040.00815.55
7.1.190.0200.00315.83
7.1.180.0040.00815.66
7.1.170.0030.00615.92
7.1.160.0060.00315.57
7.1.150.0000.01115.76
7.1.140.0040.00415.55
7.1.130.0090.00315.63
7.1.120.0040.00715.86
7.1.110.0170.00715.46
7.1.100.0060.00817.12
7.1.90.0000.01415.86
7.1.80.0060.00615.75
7.1.70.0050.00516.60
7.1.60.0050.01517.67
7.1.50.0050.01316.37
7.1.40.0030.00815.69
7.1.30.0090.00515.84
7.1.20.0090.00615.71
7.1.10.0040.01115.62
7.1.00.0030.02519.09
7.0.330.0060.00815.25
7.0.320.0100.00315.20
7.0.310.0030.00715.04
7.0.300.0090.00014.96
7.0.290.0070.00315.41
7.0.280.0040.00415.37
7.0.270.0040.00415.39
7.0.260.0000.00815.38
7.0.250.0090.00415.59
7.0.240.0000.01215.46
7.0.230.0110.00415.63
7.0.220.0030.00915.56
7.0.210.0140.00515.27
7.0.200.0030.01016.08
7.0.190.0150.00915.51
7.0.180.0080.00015.30
7.0.170.0160.00915.52
7.0.160.0050.00515.21
7.0.150.0070.00715.35
7.0.140.0080.03818.56
7.0.130.0080.01115.51
7.0.120.0030.00915.29
7.0.110.0070.00715.27
7.0.100.0040.01115.44
7.0.90.0150.00615.30
7.0.80.0120.04017.63
7.0.70.0080.03517.62
7.0.60.0050.04517.54
7.0.50.0060.04417.90
7.0.40.0030.03816.69
7.0.30.0050.05016.67
7.0.20.0050.02916.62
7.0.10.0060.04316.74
7.0.00.0030.03116.89
5.6.380.0070.00314.19
5.6.370.0150.00314.41
5.6.360.0030.00814.03
5.6.350.0070.00314.23
5.6.340.0070.00413.93
5.6.330.0030.00614.61
5.6.320.0040.00814.21
5.6.310.0120.00613.90
5.6.300.0060.00813.70
5.6.290.0060.00314.14
5.6.280.0080.04617.68
5.6.270.0100.00714.23
5.6.260.0110.00314.30
5.6.250.0040.00814.16
5.6.240.0120.00413.96
5.6.230.0130.02917.25
5.6.220.0060.04317.17
5.6.210.0050.04617.35
5.6.200.0070.04217.54
5.6.190.0070.02517.58
5.6.180.0080.04417.65
5.6.170.0080.03517.64
5.6.160.0070.03117.68
5.6.150.0050.04717.48
5.6.140.0050.04617.40
5.6.130.0050.03117.54
5.6.120.0060.03117.78
5.6.110.0160.03517.44
5.6.100.0070.03117.51
5.6.90.0090.04117.59
5.6.80.0110.02117.24
5.6.70.0130.04017.17
5.6.60.0130.02717.36
5.6.50.0130.02917.26
5.6.40.0020.02717.26
5.6.30.0060.04317.11
5.6.20.0050.04317.21
5.6.10.0060.02717.28
5.6.00.0020.03517.16
5.5.380.0130.00610.97
5.5.370.0060.02715.58
5.5.360.0030.03415.63
5.5.350.0110.03315.77
5.5.340.0060.02415.95
5.5.330.0130.03316.01
5.5.320.0090.04415.81
5.5.310.0050.03815.96
5.5.300.0080.04016.02
5.5.290.0070.04415.95
5.5.280.0110.03116.10
5.5.270.0060.03415.83
5.5.260.0050.03315.81
5.5.250.0120.03915.81
5.5.240.0030.02415.69
5.5.230.0070.04415.46
5.5.220.0090.03215.65
5.5.210.0110.02415.65
5.5.200.0040.02715.73
5.5.190.0060.04115.58
5.5.180.0090.03815.59
5.5.170.0000.00611.07
5.5.160.0100.02915.74
5.5.150.0070.04015.60
5.5.140.0030.04415.53
5.5.130.0150.04015.78
5.5.120.0050.02515.60
5.5.110.0100.03015.49
5.5.100.0070.02815.64
5.5.90.0050.03815.48
5.5.80.0140.03515.38
5.5.70.0070.03215.38
5.5.60.0080.03915.49
5.5.50.0050.02515.55
5.5.40.0070.04115.53
5.5.30.0120.03315.54
5.5.20.0070.04215.54
5.5.10.0140.03515.60
5.5.00.0130.02315.54
5.4.450.0080.04015.06
5.4.440.0050.04015.00
5.4.430.0020.02615.16
5.4.420.0040.04315.13
5.4.410.0040.03415.11
5.4.400.0110.03015.00
5.4.390.0080.03214.94
5.4.380.0180.03215.09
5.4.370.0050.04214.84
5.4.360.0060.03815.03
5.4.350.0060.03715.05
5.4.340.0090.02914.98
5.4.330.0050.00511.32
5.4.320.0030.02915.02
5.4.310.0020.02614.97
5.4.300.0070.04214.99
5.4.290.0020.04514.95
5.4.280.0080.03215.02
5.4.270.0090.01915.04
5.4.260.0090.02515.06
5.4.250.0120.03214.69
5.4.240.0070.03115.07
5.4.230.0070.03114.86
5.4.220.0080.02614.97
5.4.210.0080.04114.95
5.4.200.0100.02314.80
5.4.190.0070.03715.08
5.4.180.0090.03415.13
5.4.170.0080.03814.98
5.4.160.0080.02214.93
5.4.150.0100.04014.88
5.4.140.0020.03913.80
5.4.130.0100.03513.79
5.4.120.0080.03013.76
5.4.110.0100.03713.69
5.4.100.0060.04013.58
5.4.90.0080.02813.73
5.4.80.0050.03713.65
5.4.70.0070.02713.71
5.4.60.0030.04013.54
5.4.50.0050.02413.61
5.4.40.0050.03613.65
5.4.30.0150.03713.67
5.4.20.0020.02613.74
5.4.10.0030.03013.79
5.4.00.0120.03513.41
5.3.290.0050.02512.56
5.3.280.0060.02212.62
5.3.270.0100.03712.72
5.3.260.0030.03012.59
5.3.250.0080.03212.61
5.3.240.0060.02512.61
5.3.230.0070.04112.54
5.3.220.0070.03812.57
5.3.210.0070.02212.59
5.3.200.0050.03812.56
5.3.190.0030.04012.65
5.3.180.0100.02912.60
5.3.170.0080.02712.61
5.3.160.0040.03412.59
5.3.150.0090.03712.62
5.3.140.0070.03812.70
5.3.130.0050.04012.47
5.3.120.0060.02812.60
5.3.110.0080.02812.64
5.3.100.0060.04012.19
5.3.90.0000.02612.29
5.3.80.0070.04012.34
5.3.70.0150.03512.23
5.3.60.0050.04212.35
5.3.50.0090.03312.30
5.3.40.0020.03912.12
5.3.30.0050.03112.30
5.3.20.0050.03812.05
5.3.10.0030.03712.11
5.3.00.0040.02512.02
5.2.170.0070.02810.57
5.2.160.0060.02110.45
5.2.150.0060.02110.62
5.2.140.0060.02310.58
5.2.130.0010.03510.47
5.2.120.0000.02910.48
5.2.110.0070.03210.41
5.2.100.0050.03410.47
5.2.90.0030.03310.62
5.2.80.0060.02310.55
5.2.70.0050.03110.38
5.2.60.0030.03210.49
5.2.50.0000.02910.37
5.2.40.0050.03010.53
5.2.30.0070.02810.61
5.2.20.0050.03410.33
5.2.10.0020.03010.31
5.2.00.0070.02810.29
5.1.60.0050.01810.08
5.1.50.0060.02710.08
5.1.40.0050.0209.98
5.1.30.0030.03410.16
5.1.20.0070.02010.17
5.1.10.0060.02710.10
5.1.00.0060.02710.05
5.0.50.0030.0189.98
5.0.40.0030.0139.98
5.0.30.0060.0159.98
5.0.20.0040.0219.98
5.0.10.0030.0249.98
5.0.00.0030.0349.98
4.4.90.0020.0109.98
4.4.80.0000.0179.98
4.4.70.0020.0209.98
4.4.60.0020.0189.98
4.4.50.0030.0179.98
4.4.40.0030.0239.98
4.4.30.0030.0169.98
4.4.20.0030.0209.98
4.4.10.0020.0199.98
4.4.00.0020.0199.98
4.3.110.0020.0119.98
4.3.100.0030.0189.98
4.3.90.0000.0149.98
4.3.80.0000.0249.98
4.3.70.0050.0119.98
4.3.60.0000.0159.98
4.3.50.0030.0139.98
4.3.40.0000.0209.98
4.3.30.0020.0119.98
4.3.20.0000.0149.98
4.3.10.0020.0169.98
4.3.00.0020.0109.98

preferences:
52.56 ms | 401 KiB | 5 Q