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:]]/?)`si', '`((?<!//)(www\.\S+[[:alnum:]]/?))`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="$1" rel="nofollow">$1</a>', '<a style="color:navy;" href="http://$1" rel=\'nofollow\'>$1</a>', '<img src="$1" rel="nofollow">', //'<img src="http://$1" rel=\'nofollow\'>' ); return preg_replace($in, $out, $url); } echo replace('dfd dfdf http://site.ru/ ddd fff');

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.70.0070.01116.63
8.3.60.0080.01118.68
8.3.50.0100.00521.09
8.3.40.0040.01118.73
8.3.30.0110.00418.92
8.3.20.0060.00320.20
8.3.10.0030.00522.04
8.3.00.0080.00022.45
8.2.180.0070.00718.43
8.2.170.0120.00322.96
8.2.160.0090.00619.12
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00517.75
8.2.110.0060.00320.47
8.2.100.0000.01117.84
8.2.90.0040.00419.27
8.2.80.0030.00517.97
8.2.70.0040.00417.75
8.2.60.0030.00817.80
8.2.50.0040.00718.07
8.2.40.0040.00420.20
8.2.30.0040.00418.03
8.2.20.0000.00817.77
8.2.10.0000.00717.76
8.2.00.0000.00817.89
8.1.280.0060.00925.92
8.1.270.0050.00322.06
8.1.260.0070.00726.35
8.1.250.0040.00428.09
8.1.240.0120.00023.91
8.1.230.0000.01122.11
8.1.220.0080.00017.76
8.1.210.0050.00318.77
8.1.200.0070.00317.35
8.1.190.0000.00817.29
8.1.180.0050.00318.61
8.1.170.0000.00818.78
8.1.160.0000.00722.20
8.1.150.0030.00718.79
8.1.140.0030.00617.59
8.1.130.0030.00317.85
8.1.120.0070.00017.46
8.1.110.0040.00417.41
8.1.100.0070.00017.45
8.1.90.0100.00017.45
8.1.80.0040.00417.48
8.1.70.0030.00317.48
8.1.60.0000.00717.79
8.1.50.0000.00817.68
8.1.40.0000.00717.70
8.1.30.0050.00317.66
8.1.20.0050.00517.82
8.1.10.0000.00717.68
8.1.00.0030.00617.65
8.0.300.0040.00418.77
8.0.290.0070.00017.15
8.0.280.0000.00718.38
8.0.270.0000.00717.16
8.0.260.0030.00317.08
8.0.250.0030.00317.20
8.0.240.0060.00317.15
8.0.230.0040.00417.11
8.0.220.0000.00717.04
8.0.210.0000.00716.95
8.0.200.0000.00617.13
8.0.190.0000.00716.98
8.0.180.0090.00017.08
8.0.170.0000.00816.96
8.0.160.0090.00016.92
8.0.150.0090.00316.95
8.0.140.0000.00717.00
8.0.130.0060.00013.46
8.0.120.0000.00816.90
8.0.110.0040.00417.09
8.0.100.0030.00516.99
8.0.90.0050.00316.91
8.0.80.0070.00717.08
8.0.70.0070.00016.95
8.0.60.0060.00316.96
8.0.50.0040.00416.89
8.0.30.0110.00817.37
8.0.20.0090.01017.40
8.0.10.0000.00717.23
8.0.00.0150.00217.03
7.4.330.0030.00315.00
7.4.320.0000.00616.52
7.4.300.0030.00316.86
7.4.290.0030.00316.82
7.4.280.0000.00816.80
7.4.270.0030.00316.75
7.4.260.0030.00316.60
7.4.250.0040.00416.79
7.4.240.0050.00216.83
7.4.230.0030.00316.72
7.4.220.0150.00316.92
7.4.210.0100.01116.76
7.4.200.0070.00016.52
7.4.190.0040.00416.95
7.4.160.0030.01316.70
7.4.150.0120.00617.40
7.4.140.0160.00517.86
7.4.130.0050.01316.70
7.4.120.0100.00716.74
7.4.110.0110.00516.89
7.4.100.0090.01216.66
7.4.90.0100.01316.83
7.4.80.0090.00919.39
7.4.70.0070.01016.78
7.4.60.0060.01016.62
7.4.50.0040.00416.71
7.4.40.0150.00322.77
7.4.30.0040.01416.76
7.4.00.0110.00615.16
7.3.330.0030.00313.42
7.3.320.0000.00513.37
7.3.310.0000.00716.56
7.3.300.0000.00716.34
7.3.290.0130.00616.50
7.3.280.0090.01216.46
7.3.270.0120.00917.40
7.3.260.0060.01916.55
7.3.250.0090.01116.54
7.3.240.0030.01316.71
7.3.230.0120.00616.48
7.3.210.0090.00916.66
7.3.200.0130.01019.39
7.3.190.0140.00316.50
7.3.180.0070.00716.55
7.3.170.0060.01016.52
7.3.160.0090.00916.60
7.3.120.0020.01615.03
7.3.110.0080.01115.07
7.3.100.0000.01114.96
7.3.90.0100.00014.72
7.3.80.0030.00814.91
7.3.70.0090.00614.98
7.3.60.0120.00014.82
7.3.50.0070.01115.07
7.3.40.0110.00714.73
7.3.30.0030.01614.79
7.3.20.0120.00316.84
7.3.10.0070.00716.93
7.3.00.0110.00416.82
7.2.330.0140.00316.86
7.2.320.0040.01416.86
7.2.310.0100.00716.73
7.2.300.0090.00916.81
7.2.290.0100.00616.71
7.2.250.0000.01814.93
7.2.240.0030.01615.06
7.2.230.0060.00915.29
7.2.220.0090.00615.35
7.2.210.0080.00715.16
7.2.200.0030.01015.11
7.2.190.0070.01015.11
7.2.180.0030.01215.37
7.2.170.0090.00315.08
7.2.60.0030.00717.05
7.2.00.0060.00619.75
7.1.330.0070.00716.07
7.1.320.0030.01015.89
7.1.310.0070.01015.96
7.1.300.0030.00715.99
7.1.290.0100.00615.59
7.1.280.0090.00616.00
7.1.270.0040.01116.03
7.1.260.0090.00615.95
7.1.200.0090.00615.89
7.1.70.0030.00517.22
7.1.60.0030.00717.50
7.1.50.0120.00916.93
7.1.00.0000.04722.45
7.0.200.0180.00916.89
7.0.140.0100.06722.07
7.0.60.0170.05319.83
7.0.50.0070.04017.74
7.0.40.0170.07720.08
7.0.30.0270.04020.21
7.0.20.0230.07320.08
7.0.10.0200.04720.21
7.0.00.0000.09320.07
5.6.280.0030.07321.12
5.6.210.0070.03720.59
5.6.200.0000.09018.22
5.6.190.0130.05320.67
5.6.180.4000.03320.67
5.6.170.0200.04720.46
5.6.160.0000.04720.46
5.6.150.0030.04318.21
5.6.140.0030.06718.21
5.6.130.0070.04318.18
5.6.120.0100.08320.90
5.6.110.0030.04721.00
5.6.100.0000.05020.98
5.6.90.0170.07021.00
5.6.80.0100.08020.51
5.6.70.0270.07020.40
5.5.350.0230.06320.34
5.5.340.0030.08717.94
5.5.330.0030.09020.27
5.5.320.0270.05020.26
5.5.310.0170.06020.24
5.5.300.0000.07318.04
5.5.290.0100.07018.07
5.5.280.0100.05320.85
5.5.270.0070.04020.98
5.5.260.0000.09720.78
5.5.250.0070.08020.66
5.5.240.0170.07020.20
5.4.450.0500.06019.31
5.4.440.0670.06719.30
5.4.430.0670.05019.46
5.4.420.0230.04719.47
5.4.410.0070.06019.20
5.4.400.1230.06718.66
5.4.390.1170.05318.61
5.4.380.0400.06318.76
5.4.370.0100.06018.56
5.4.360.0130.05018.59
5.4.350.0200.05018.61
5.4.340.0270.06718.47
5.4.320.0060.03912.51
5.4.310.0070.04612.50
5.4.300.0060.03712.51
5.4.290.0070.03812.50
5.4.280.0060.03512.40
5.4.270.0080.04112.40
5.4.260.0130.06719.01
5.4.250.0200.06318.79
5.4.240.0230.06018.74
5.4.230.0100.06318.94
5.4.220.0100.06718.98
5.4.210.0000.07318.77
5.4.200.0070.07018.79
5.4.190.0200.06019.08
5.4.180.0100.05718.95
5.4.170.0200.06318.78
5.4.160.0130.06318.63
5.4.150.0170.05718.64
5.4.140.0070.08016.40
5.4.130.0100.05016.59
5.4.120.0130.04316.51
5.4.110.0200.05316.52
5.4.100.0130.04716.42
5.4.90.0130.05316.61
5.4.80.0130.05316.51
5.4.70.0130.04716.50
5.4.60.0200.07016.29
5.4.50.0070.05016.52
5.4.40.0170.04316.39
5.4.30.0030.06716.58
5.4.20.0070.07316.33
5.4.10.0100.06316.40
5.4.00.0230.05315.91
5.3.290.0080.04012.80
5.3.280.0130.07014.75
5.3.270.0170.05014.73
5.3.260.0270.04314.67
5.3.250.0100.05014.76
5.3.240.0130.05314.76
5.3.230.0100.05314.68
5.3.220.0070.06014.57
5.3.210.0170.04714.70
5.3.200.0070.06314.65
5.3.190.0130.05014.73
5.3.180.0070.05714.48
5.3.170.0100.06014.70
5.3.160.0070.05714.63
5.3.150.0200.06014.72
5.3.140.0030.05714.54
5.3.130.0030.06314.67
5.3.120.0100.05014.73
5.3.110.0130.04714.51
5.3.100.0170.05014.02
5.3.90.0100.06714.01
5.3.80.0070.05014.09
5.3.70.0030.05314.09
5.3.60.0130.05014.07
5.3.50.0100.04713.95
5.3.40.0000.07314.03
5.3.30.0030.07014.07
5.3.20.0070.07013.71
5.3.10.0030.06013.73
5.3.00.0070.05013.62
5.2.170.0100.05311.21
5.2.160.0000.06311.30
5.2.150.0030.06311.13
5.2.140.0100.03711.22
5.2.130.0030.05311.32
5.2.120.0030.05311.08
5.2.110.0000.05011.18
5.2.100.0070.04311.18
5.2.90.0030.05311.16
5.2.80.0000.06711.25
5.2.70.0000.05011.08
5.2.60.0130.05311.13
5.2.50.0070.04711.19
5.2.40.0100.05310.98
5.2.30.0000.05310.88
5.2.20.0070.05310.95
5.2.10.0070.04710.93
5.2.00.0270.04010.63
5.1.60.0070.0339.91
5.1.50.0070.04710.05
5.1.40.0170.02710.07
5.1.30.0100.03710.40
5.1.20.0030.05310.51
5.1.10.0070.03310.04
5.1.00.0070.03310.02
5.0.50.0070.0278.61
5.0.40.0070.0238.25
5.0.30.0000.0438.22
5.0.20.0030.0338.43
5.0.10.0130.0238.24
5.0.00.0100.0338.21
4.4.90.0030.0207.45
4.4.80.0000.0307.45
4.4.70.0070.0237.45
4.4.60.0070.0237.45
4.4.50.0030.0207.45
4.4.40.0000.0377.45
4.4.30.0000.0237.45
4.4.20.0000.0277.45
4.4.10.0000.0337.45
4.4.00.0030.0337.45
4.3.110.0000.0337.45
4.3.100.0070.0177.45
4.3.90.0000.0277.45
4.3.80.0000.0437.45
4.3.70.0070.0177.45
4.3.60.0030.0307.45
4.3.50.0070.0207.45
4.3.40.0070.0407.45
4.3.30.0000.0307.45
4.3.20.0030.0237.45
4.3.10.0070.0177.45
4.3.00.0130.0278.67

preferences:
43.3 ms | 401 KiB | 5 Q