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.0130.00618.43
8.3.50.0100.00521.09
8.3.40.0090.00618.81
8.3.30.0150.00018.95
8.3.20.0030.00620.24
8.3.10.0040.00421.98
8.3.00.0050.00222.44
8.2.180.0100.01016.63
8.2.170.0170.00322.96
8.2.160.0070.00719.03
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00817.75
8.2.110.0060.00322.23
8.2.100.0160.00017.72
8.2.90.0040.00419.11
8.2.80.0080.00018.04
8.2.70.0090.00017.63
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0000.00820.20
8.2.30.0050.00318.03
8.2.20.0050.00317.68
8.2.10.0020.00517.83
8.2.00.0070.00017.74
8.1.280.0120.00925.92
8.1.270.0070.00022.02
8.1.260.0110.00326.35
8.1.250.0030.00528.09
8.1.240.0060.00323.70
8.1.230.0110.00019.02
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0000.00917.38
8.1.190.0050.00317.30
8.1.180.0000.00818.75
8.1.170.0040.00418.39
8.1.160.0050.00222.14
8.1.150.0100.00018.71
8.1.140.0070.00017.45
8.1.130.0030.00317.84
8.1.120.0000.00917.50
8.1.110.0030.00517.44
8.1.100.0000.00717.43
8.1.90.0060.00317.47
8.1.80.0000.00817.58
8.1.70.0000.00717.49
8.1.60.0060.00317.75
8.1.50.0000.00717.71
8.1.40.0030.00617.63
8.1.30.0060.00317.79
8.1.20.0060.00317.72
8.1.10.0040.00417.64
8.1.00.0080.00017.59
8.0.300.0000.00818.77
8.0.290.0040.00417.04
8.0.280.0070.00018.49
8.0.270.0070.00017.28
8.0.260.0070.00016.89
8.0.250.0000.00717.02
8.0.240.0030.00717.12
8.0.230.0000.00717.03
8.0.220.0070.00016.95
8.0.210.0000.00716.88
8.0.200.0000.00717.05
8.0.190.0020.00516.90
8.0.180.0030.00517.04
8.0.170.0000.00816.99
8.0.160.0000.00816.91
8.0.150.0070.00316.97
8.0.140.0070.00016.81
8.0.130.0060.00013.46
8.0.120.0000.00716.93
8.0.110.0040.00416.93
8.0.100.0050.00316.82
8.0.90.0000.00816.93
8.0.80.0040.01116.92
8.0.70.0000.00816.79
8.0.60.0000.00816.87
8.0.50.0040.00416.96
8.0.30.0070.01217.20
8.0.20.0110.00817.49
8.0.10.0040.00417.04
8.0.00.0030.01516.82
7.4.330.0070.00015.00
7.4.320.0060.00016.56
7.4.300.0000.00616.62
7.4.290.0040.00416.66
7.4.280.0000.00716.62
7.4.270.0030.00316.72
7.4.260.0070.00016.75
7.4.250.0040.00416.77
7.4.240.0020.00616.73
7.4.230.0070.00016.81
7.4.220.0100.01316.84
7.4.210.0090.00816.76
7.4.200.0040.00416.86
7.4.190.0040.00416.59
7.4.160.0070.01016.59
7.4.150.0060.01117.40
7.4.140.0100.01017.86
7.4.130.0100.01016.52
7.4.120.0110.00616.76
7.4.110.0130.00316.83
7.4.100.0120.00816.60
7.4.90.0100.00616.70
7.4.80.0060.01719.39
7.4.70.0090.01516.66
7.4.60.0070.01516.61
7.4.50.0000.00816.57
7.4.40.0140.00322.77
7.4.30.0060.00916.87
7.4.00.0040.01214.97
7.3.330.0030.00313.34
7.3.320.0000.00513.40
7.3.310.0040.00416.40
7.3.300.0000.00716.40
7.3.290.0000.01416.40
7.3.280.0100.00716.43
7.3.270.0120.00617.40
7.3.260.0090.01516.47
7.3.250.0110.00916.38
7.3.240.0070.01316.79
7.3.230.0060.01516.75
7.3.210.0070.01016.45
7.3.200.0100.01319.39
7.3.190.0110.01116.42
7.3.180.0070.01516.70
7.3.170.0130.00316.63
7.3.160.0040.01116.51
7.3.120.0060.00915.11
7.2.330.0030.01316.66
7.2.320.0070.01016.94
7.2.310.0070.01016.66
7.2.300.0110.00516.93
7.2.290.0060.01016.82
7.2.60.0090.00316.99
7.2.00.0060.00619.48
7.1.200.0040.00815.63
7.1.100.0070.01018.54
7.1.70.0040.00417.14
7.1.60.0100.01319.82
7.1.50.0110.01417.00
7.1.00.0000.04722.48
7.0.200.0040.00416.89
7.0.140.0000.07721.92
7.0.120.0000.07022.21
7.0.110.0100.07021.96
7.0.100.0030.07322.08
7.0.90.0000.08022.10
7.0.80.0070.06722.02
7.0.70.0100.06322.05
7.0.60.0000.07722.01
7.0.50.0000.07722.09
7.0.40.0070.07022.11
7.0.30.0070.06722.07
7.0.20.0000.07722.17
7.0.10.0030.05721.97
7.0.00.0070.07022.18
5.6.280.0000.07320.78
5.6.260.0030.06321.05
5.6.250.0030.06721.08
5.6.240.0070.07021.02
5.6.230.0030.07320.83
5.6.220.0030.06721.08
5.6.210.0000.07020.95
5.6.200.0030.07720.95
5.6.190.0070.06020.84
5.6.180.0000.07321.04
5.6.170.0030.07321.08
5.6.160.0000.07321.06
5.6.150.0030.07720.80
5.6.140.0000.07721.08
5.6.130.0000.04321.05
5.6.120.0030.03320.75
5.6.110.0000.07320.73
5.6.100.0000.07720.79
5.6.90.0000.06320.79
5.6.80.0070.06720.33
5.6.70.0070.06020.30
5.6.60.0100.06720.43
5.6.50.0030.07020.46
5.6.40.0070.06720.33
5.6.30.0030.06320.36
5.6.20.0070.07020.27
5.6.10.0070.06720.36
5.6.00.0000.06320.27
5.5.380.0030.07017.68
5.5.370.0000.07317.69
5.5.360.0030.07317.55
5.5.350.0030.07017.52
5.5.340.0000.06318.13
5.5.330.0000.06018.10
5.5.320.0070.07017.96
5.5.310.0000.07718.22
5.5.300.0030.05318.05
5.5.290.0030.04318.10
5.5.280.0100.07018.12
5.5.270.0000.07717.95
5.5.260.0000.07317.91
5.5.250.0000.06017.64
5.5.240.0000.07017.30
5.5.230.0070.06717.47
5.5.220.0030.07017.61
5.5.210.0030.05717.29
5.5.200.0030.06717.49
5.5.190.0070.07017.31
5.5.180.0070.07017.45
5.5.160.0030.06717.45
5.5.150.0030.05317.45
5.5.140.0030.06017.45
5.5.130.0070.06717.61
5.5.120.0030.07017.57
5.5.110.0070.06317.47
5.5.100.0000.07317.16
5.5.90.0070.06317.38
5.5.80.0030.06717.08
5.5.70.0000.07317.29
5.5.60.0000.07017.31
5.5.50.0030.06717.15
5.5.40.0070.05717.46
5.5.30.0070.06317.46
5.5.20.0030.06717.17
5.5.10.0000.06317.31
5.5.00.0070.06717.37
5.4.450.0030.07319.48
5.4.440.0030.07319.33
5.4.430.0030.07019.50
5.4.420.0100.05319.45
5.4.410.0030.06019.28
5.4.400.0030.06719.02
5.4.390.0030.06719.25
5.4.380.0030.06719.09
5.4.370.0000.07019.18
5.4.360.0100.06019.00
5.4.350.0030.06719.31
5.4.340.0070.06719.25
5.4.320.0030.06019.18
5.4.310.0030.06019.00
5.4.300.0030.06718.98
5.4.290.0000.07019.02
5.4.280.0100.06718.94
5.4.270.0070.05318.98
5.4.260.0030.07019.24
5.4.250.0030.06719.30
5.4.240.0000.07019.15
5.4.230.0030.05718.94
5.4.220.0000.07319.24
5.4.210.0000.07018.98
5.4.200.0100.06019.23
5.4.190.0030.06319.30
5.4.180.0070.06318.95
5.4.170.0100.06319.29
5.4.160.0000.06718.98
5.4.150.0000.07318.93
5.4.140.0000.07016.61
5.4.130.0030.06016.43
5.4.120.0100.05016.36
5.4.110.0030.06316.47
5.4.100.0000.06316.43
5.4.90.0000.05316.62
5.4.80.0100.05716.54
5.4.70.0030.06316.59
5.4.60.0030.06316.52
5.4.50.0000.06316.28
5.4.40.0000.06716.57
5.4.30.0030.06316.38
5.4.20.0030.06316.39
5.4.10.0000.06316.59
5.4.00.0000.06715.91
5.3.290.0030.07014.89
5.3.280.0030.06314.59
5.3.270.0000.07314.58
5.3.260.0000.07314.64
5.3.250.0030.06314.61
5.3.240.0000.07014.59
5.3.230.0030.06014.45
5.3.220.0000.07014.42
5.3.210.0070.06314.59
5.3.200.0030.06714.57
5.3.190.0000.07014.57
5.3.180.0000.06714.67
5.3.170.0030.06314.57
5.3.160.0000.06714.59
5.3.150.0070.06314.69
5.3.140.0030.06314.41
5.3.130.0030.07014.57
5.3.120.0070.06314.63
5.3.110.0030.07014.56
5.3.100.0030.06714.17
5.3.90.0070.06013.88
5.3.80.0000.06714.01
5.3.70.0030.06314.01
5.3.60.0000.06714.09
5.3.50.0000.06713.94
5.3.40.0030.06313.98
5.3.30.0000.06713.91
5.3.20.0030.06013.91
5.3.10.0000.06313.80
5.3.00.0070.06313.64
5.2.170.0030.05711.09
5.2.160.0000.05011.14
5.2.150.0030.05711.22
5.2.140.0000.05711.20
5.2.130.0000.05011.10
5.2.120.0070.05011.13
5.2.110.0030.05711.07
5.2.100.0030.05011.23
5.2.90.0030.05011.08
5.2.80.0000.05311.09
5.2.70.0030.05311.17
5.2.60.0030.05311.01
5.2.50.0070.04711.02
5.2.40.0030.05310.96
5.2.30.0000.05710.99
5.2.20.0030.05311.20
5.2.10.0030.05010.94
5.2.00.0000.05310.57
5.1.60.0000.0479.99
5.1.50.0030.04710.26
5.1.40.0070.04310.05
5.1.30.0030.04710.32
5.1.20.0030.04710.31
5.1.10.0030.04710.06
5.1.00.0000.05010.03
5.0.50.0030.0379.91
5.0.40.0030.0379.91
5.0.30.0000.0579.91
5.0.20.0000.0379.91
5.0.10.0000.0409.91
5.0.00.0030.0539.91
4.4.90.0030.0279.91
4.4.80.0000.0309.91
4.4.70.0000.0309.91
4.4.60.0000.0309.91
4.4.50.0000.0339.91
4.4.40.0000.0509.91
4.4.30.0070.0279.91
4.4.20.0030.0309.91
4.4.10.0000.0309.91
4.4.00.0000.0439.91
4.3.110.0070.0279.91
4.3.100.0030.0279.91
4.3.90.0000.0309.91
4.3.80.0000.0479.91
4.3.70.0000.0309.91
4.3.60.0000.0309.91
4.3.50.0030.0279.91
4.3.40.0000.0479.91
4.3.30.0000.0339.91
4.3.20.0030.0309.91
4.3.10.0000.0309.91
4.3.00.0000.0279.91

preferences:
48.25 ms | 401 KiB | 5 Q