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 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.0140.00718.68
8.3.50.0090.00521.14
8.3.40.0100.00718.67
8.3.30.0170.00019.15
8.3.20.0060.00320.20
8.3.10.0060.00321.92
8.3.00.0070.00022.39
8.2.180.0000.01416.63
8.2.170.0070.00722.96
8.2.160.0080.00819.08
8.2.150.0000.00824.18
8.2.140.0090.00924.66
8.2.130.0040.00426.16
8.2.120.0120.00017.63
8.2.110.0110.00022.26
8.2.100.0050.01017.72
8.2.90.0030.00619.23
8.2.80.0040.00417.97
8.2.70.0030.00617.74
8.2.60.0090.00018.03
8.2.50.0040.00418.07
8.2.40.0040.00420.07
8.2.30.0000.00817.98
8.2.20.0080.00017.89
8.2.10.0070.00017.73
8.2.00.0050.00317.79
8.1.280.0180.00425.92
8.1.270.0040.00421.88
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0100.00024.02
8.1.230.0040.00719.01
8.1.220.0030.00517.78
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0050.00318.61
8.1.170.0000.00818.48
8.1.160.0000.00822.18
8.1.150.0000.01118.74
8.1.140.0040.00417.55
8.1.130.0030.00317.79
8.1.120.0080.00017.61
8.1.110.0040.00417.52
8.1.100.0070.00017.61
8.1.90.0030.00617.55
8.1.80.0030.00517.46
8.1.70.0030.00317.52
8.1.60.0030.00517.78
8.1.50.0060.00317.70
8.1.40.0030.00517.68
8.1.30.0000.00817.65
8.1.20.0030.00517.82
8.1.10.0070.00017.70
8.1.00.0080.00017.68
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0040.00418.42
8.0.270.0070.00017.31
8.0.260.0030.00316.87
8.0.250.0040.00417.12
8.0.240.0100.00017.11
8.0.230.0040.00416.95
8.0.220.0030.00317.02
8.0.210.0040.00416.99
8.0.200.0000.00816.97
8.0.190.0040.00416.99
8.0.180.0040.00417.00
8.0.170.0040.00416.94
8.0.160.0000.00816.92
8.0.150.0050.00316.95
8.0.140.0000.00716.86
8.0.130.0030.00313.30
8.0.120.0020.00517.02
8.0.110.0030.00516.97
8.0.100.0050.00216.97
8.0.90.0040.00416.88
8.0.80.0070.00716.95
8.0.70.0000.00817.08
8.0.60.0070.00017.05
8.0.50.0040.00417.02
8.0.30.0110.00917.29
8.0.20.0070.01217.41
8.0.10.0050.00217.15
8.0.00.0070.01417.04
7.4.330.0070.00015.00
7.4.320.0000.00616.77
7.4.300.0000.00716.71
7.4.290.0070.00016.67
7.4.280.0050.00216.80
7.4.270.0000.00716.68
7.4.260.0050.00316.80
7.4.250.0080.00016.69
7.4.240.0030.00516.79
7.4.230.0030.00316.76
7.4.220.0070.01016.86
7.4.210.0080.00716.82
7.4.200.0000.00716.63
7.4.190.0000.00716.91
7.4.160.0060.01016.83
7.4.150.0180.00017.40
7.4.140.0120.00717.86
7.4.130.0110.00616.78
7.4.120.0100.00816.63
7.4.110.0090.00916.80
7.4.100.0120.01216.66
7.4.90.0230.00016.68
7.4.80.0140.00319.39
7.4.70.0100.00716.66
7.4.60.0150.00716.67
7.4.50.0040.00416.66
7.4.40.0120.00322.77
7.4.30.0130.00316.92
7.4.00.0030.01215.36
7.3.330.0050.00213.40
7.3.320.0050.00013.26
7.3.310.0090.00016.40
7.3.300.0000.00716.42
7.3.290.0110.00716.38
7.3.280.0090.00916.38
7.3.270.0100.00717.40
7.3.260.0110.00716.85
7.3.250.0070.01116.43
7.3.240.0130.01016.50
7.3.230.0030.01416.63
7.3.210.0030.01316.73
7.3.200.0090.00619.39
7.3.190.0150.00316.43
7.3.180.0070.01016.83
7.3.170.0080.00816.83
7.3.160.0090.00916.66
7.3.120.0070.01014.85
7.3.10.0030.01016.59
7.3.00.0100.00016.71
7.2.330.0120.00616.81
7.2.320.0070.01016.89
7.2.310.0040.01316.76
7.2.300.0050.01116.75
7.2.290.0030.01316.79
7.2.130.0060.01017.11
7.2.120.0000.01417.18
7.2.110.0070.01017.09
7.2.100.0090.00617.18
7.2.90.0100.00317.27
7.2.80.0040.00717.13
7.2.70.0070.00717.13
7.2.60.0060.00916.86
7.2.50.0040.00816.84
7.2.40.0070.00417.28
7.2.30.0100.00317.25
7.2.20.0070.00716.94
7.2.10.0040.01217.21
7.2.00.0030.01018.32
7.1.250.0030.01016.05
7.1.100.0030.01218.56
7.1.70.0000.00717.47
7.1.60.0090.01619.82
7.1.50.0030.02117.00
7.1.00.0030.07722.43
7.0.200.0040.00416.91
7.0.140.0130.06722.15
7.0.60.0030.04319.98
7.0.50.0070.04717.89
7.0.40.0070.07020.13
7.0.30.0200.04020.15
7.0.20.0400.07720.15
7.0.10.0270.07720.36
7.0.00.0030.09320.23
5.6.210.0170.07320.65
5.6.200.0030.05718.27
5.6.190.0100.06020.47
5.6.180.0370.05720.45
5.6.170.0200.08320.57
5.6.160.0070.08320.50
5.6.150.0000.05718.25
5.6.140.0100.04318.28
5.6.130.0000.04318.19
5.6.120.0130.07721.03
5.6.110.0070.07021.02
5.6.100.0100.06720.98
5.6.90.0030.08720.97
5.6.80.0070.06020.41
5.6.70.0270.07020.53
5.5.350.0170.05720.41
5.5.340.0000.07717.93
5.5.330.0030.04020.37
5.5.320.0030.04720.39
5.5.310.0230.06720.32
5.5.300.0030.05318.03
5.5.290.0070.04017.95
5.5.280.0030.04320.99
5.5.270.0130.07720.79
5.5.260.0070.08020.68
5.5.250.0000.06020.66
5.5.240.0100.07320.25
5.4.450.0400.06319.61
5.4.440.0100.06019.34
5.4.430.0070.06019.45
5.4.420.0170.06019.16
5.4.410.0000.06319.07
5.4.400.1000.06018.84
5.4.390.1100.05018.72
5.4.380.0200.06318.81
5.4.370.0070.06018.80
5.4.360.0070.05718.82
5.4.350.0170.05318.74
5.4.340.0270.04318.75
5.4.320.0070.04112.51
5.4.310.0060.04112.50
5.4.300.0060.03712.50
5.4.290.0070.04812.50
5.4.280.0080.04212.40
5.4.270.0090.03912.40
5.4.260.0100.07719.00
5.4.250.0170.04718.88
5.4.240.0170.04318.73
5.4.230.0170.06318.97
5.4.220.0170.07718.92
5.4.210.0030.06318.84
5.4.200.0130.06718.94
5.4.190.0100.05318.73
5.4.180.0100.05018.96
5.4.170.0130.05018.84
5.4.160.0070.05718.96
5.4.150.0200.05718.88
5.4.140.0100.05316.57
5.4.130.0200.06316.35
5.4.120.0270.05016.59
5.4.110.0130.05016.43
5.4.100.0170.05016.54
5.4.90.0170.05716.46
5.4.80.0130.05016.51
5.4.70.0100.06716.45
5.4.60.0070.06716.61
5.4.50.0170.05716.33
5.4.40.0170.05316.68
5.4.30.0100.05016.45
5.4.20.0130.07016.29
5.4.10.0130.07716.48
5.4.00.0100.05716.04
5.3.290.0070.04012.80
5.3.280.0130.07714.51
5.3.270.0170.07314.77
5.3.260.0170.06714.62
5.3.250.0000.05714.43
5.3.240.0100.07314.69
5.3.230.0170.06014.68
5.3.220.0100.07014.47
5.3.210.0130.06014.40
5.3.200.0100.07714.55
5.3.190.0000.06714.65
5.3.180.0070.06714.64
5.3.170.0100.04714.70
5.3.160.0130.05714.41
5.3.150.0130.06014.73
5.3.140.0070.08014.54
5.3.130.0070.08014.63
5.3.120.0130.05314.52
5.3.110.0200.04714.54
5.3.100.0070.06714.25
5.3.90.0230.06014.09
5.3.80.0000.05714.03
5.3.70.0070.05314.24
5.3.60.0170.06013.96
5.3.50.0100.05313.96
5.3.40.0200.05313.78
5.3.30.0130.06713.98
5.3.20.0130.06013.53
5.3.10.0170.05313.73
5.3.00.0100.05013.70
5.2.170.0100.04711.23
5.2.160.0130.03311.32
5.2.150.0070.06311.23
5.2.140.0270.03711.12
5.2.130.0030.05711.18
5.2.120.0100.05011.18
5.2.110.0130.04011.17
5.2.100.0130.05011.32
5.2.90.0100.05311.16
5.2.80.0070.05311.31
5.2.70.0030.04711.17
5.2.60.0070.04710.89
5.2.50.0070.06011.02
5.2.40.0100.04711.10
5.2.30.0030.06310.97
5.2.20.0030.05310.95
5.2.10.0030.05710.94
5.2.00.0130.03310.79
5.1.60.0000.04010.06
5.1.50.0070.0379.98
5.1.40.0100.03310.02
5.1.30.0030.05010.42
5.1.20.0100.04010.25
5.1.10.0100.03310.02
5.1.00.0100.04710.13
5.0.50.0070.0308.61
5.0.40.0030.0338.41
5.0.30.0070.0408.24
5.0.20.0100.0308.21
5.0.10.0030.0338.41
5.0.00.0030.0538.17
4.4.90.0030.0307.27
4.4.80.0000.0307.27
4.4.70.0070.0207.27
4.4.60.0030.0207.27
4.4.50.0030.0237.27
4.4.40.0030.0377.27
4.4.30.0100.0137.27
4.4.20.0070.0237.27
4.4.10.0070.0307.27
4.4.00.0100.0377.27
4.3.110.0100.0177.27
4.3.100.0100.0177.27
4.3.90.0030.0307.27
4.3.80.0130.0337.27
4.3.70.0030.0237.27
4.3.60.0070.0207.27
4.3.50.0000.0277.27
4.3.40.0000.0377.27
4.3.30.0100.0207.27
4.3.20.0000.0337.27
4.3.10.0030.0207.27
4.3.00.0100.0236.95

preferences:
43.66 ms | 401 KiB | 5 Q