3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\[@url\|([^|]+)\|(\d+)\](?=(?>.*\R+)+^\[\2]:\s+(\S+))|^\[\d+]:\h+\S+/m'; $str = 'We have [@url|first url|1] and the [@url|the second url|2] and then [@url|the third url|3] [1]: https://www.google.com [2]: www.facebook.com [3]: http://www.amazon.com'; echo preg_replace_callback($re, function($match) { if (isset($match[1])) { return "<a href=\"{$match[3]}\">{$match[1]}</a>"; } }, $str);

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.5.10.0100.00817.11
8.5.00.0140.01020.32
8.4.150.0020.00014.05
8.4.140.0070.00217.98
8.4.130.0140.00718.04
8.4.120.0020.00722.16
8.4.110.0090.01222.29
8.4.100.0040.00517.98
8.4.90.0110.00818.64
8.4.80.0100.01018.07
8.4.70.0060.00317.96
8.4.60.0120.00918.56
8.4.50.0110.00619.74
8.4.40.0120.01019.50
8.4.30.0090.00617.95
8.4.20.0140.00720.48
8.4.10.0130.00717.85
8.3.280.0110.01118.53
8.3.270.0040.00516.71
8.3.260.0120.00816.93
8.3.250.0120.00719.03
8.3.240.0130.00816.62
8.3.230.0110.00416.79
8.3.220.0140.00517.26
8.3.210.0100.00416.84
8.3.200.0040.00516.56
8.3.190.0090.00518.87
8.3.180.0060.01218.66
8.3.170.0090.00017.26
8.3.160.0120.00617.09
8.3.150.0160.00318.73
8.3.140.0040.00416.66
8.3.130.0000.00818.63
8.3.120.0060.00320.67
8.3.110.0040.00420.94
8.3.100.0030.00516.36
8.3.90.0040.00418.41
8.3.80.0000.00918.43
8.3.70.0140.01118.43
8.3.60.0150.00318.43
8.3.50.0110.00718.05
8.3.40.0090.00618.88
8.3.30.0070.00718.69
8.3.20.0080.00021.90
8.3.10.0040.00423.48
8.3.00.0080.00020.81
8.2.290.0130.00622.43
8.2.280.0110.00818.48
8.2.270.0060.00316.72
8.2.260.0000.00817.28
8.2.250.0000.00818.77
8.2.240.0100.00717.32
8.2.230.0090.00022.58
8.2.220.0090.00024.06
8.2.210.0050.00326.77
8.2.200.0070.00318.67
8.2.190.0090.00620.49
8.2.180.0150.00416.49
8.2.170.0190.00322.96
8.2.160.0110.00320.05
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.13
8.2.110.0030.00619.24
8.2.100.0000.01218.09
8.2.90.0000.00818.30
8.2.80.0040.00418.13
8.2.70.0000.00818.16
8.2.60.0050.00318.22
8.2.50.0030.00618.10
8.2.40.0050.00319.52
8.2.30.0040.00419.49
8.2.20.0000.00818.04
8.2.10.0040.00419.23
8.2.00.0000.00719.17
8.1.330.0110.00721.89
8.1.320.0100.01116.48
8.1.310.0040.01116.85
8.1.300.0150.00318.34
8.1.290.0060.00318.88
8.1.280.0140.00325.92
8.1.270.0070.00318.80
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0040.00817.58
8.1.230.0080.00320.92
8.1.220.0050.00317.79
8.1.210.0050.00318.95
8.1.200.0050.00517.50
8.1.190.0030.00517.48
8.1.180.0080.00018.10
8.1.170.0000.00818.70
8.1.160.0040.00418.94
8.1.150.0000.00818.93
8.1.140.0030.00322.15
8.1.130.0030.00722.01
8.1.120.0100.00017.53
8.1.110.0050.00517.68
8.1.100.0100.00017.54
8.1.90.0040.00417.60
8.1.80.0000.00817.52
8.1.70.0000.00717.59
8.1.60.0080.00017.65
8.1.50.0000.00917.58
8.1.40.0060.00317.60
8.1.30.0060.00317.79
8.1.20.0000.00917.73
8.1.10.0030.00617.65
8.1.00.0040.00417.68
8.0.300.0000.00719.77
8.0.290.0060.00316.88
8.0.280.0070.00018.57
8.0.270.0000.00817.32
8.0.260.0070.00018.42
8.0.250.0000.00717.05
8.0.240.0000.00717.02
8.0.230.0000.00817.03
8.0.220.0040.00416.97
8.0.210.0040.00416.95
8.0.200.0030.00317.14
8.0.190.0080.00017.07
8.0.180.0040.00417.09
8.0.170.0040.00417.06
8.0.160.0040.00417.02
8.0.150.0070.00016.90
8.0.140.0040.00417.00
8.0.130.0050.00013.52
8.0.120.0050.00317.03
8.0.110.0040.00417.05
8.0.100.0040.00417.01
8.0.90.0040.00416.95
8.0.80.0120.00617.04
8.0.70.0050.00216.92
8.0.60.0000.00716.97
8.0.50.0050.00216.84
8.0.30.0140.00716.98
8.0.20.0120.00817.32
8.0.10.0060.00317.24
8.0.00.0100.01017.05
7.4.330.0050.00015.55
7.4.320.0000.00716.79
7.4.300.0070.00016.83
7.4.290.0040.00416.83
7.4.280.0040.00416.83
7.4.270.0040.00416.88
7.4.260.0000.00716.78
7.4.250.0040.00416.68
7.4.240.0040.00416.66
7.4.230.0030.00316.67
7.4.220.0030.00616.82
7.4.210.0120.00316.79
7.4.200.0000.00716.68
7.4.160.0110.00816.78
7.4.140.0090.01017.86
7.4.130.0100.00716.72
7.4.120.0100.01116.69
7.4.110.0070.01416.66
7.4.100.0140.00816.81
7.4.90.0150.00316.57
7.4.80.0030.01419.39
7.4.70.0090.00916.79
7.4.60.0030.02016.76
7.4.50.0130.00316.80
7.4.40.0130.01016.80
7.4.00.0050.01215.07
7.3.330.0050.00013.32
7.3.320.0030.00313.39
7.3.310.0000.00716.53
7.3.300.0030.00516.55
7.3.290.0000.00716.35
7.3.280.0090.01016.45
7.3.260.0080.01016.65
7.3.240.0120.00816.48
7.3.230.0100.00716.54
7.3.210.0140.00316.74
7.3.200.0060.01216.73
7.3.190.0060.01716.41
7.3.180.0070.01016.54
7.3.170.0090.00916.76
7.3.160.0100.00616.63
7.3.120.0110.00714.93
7.3.110.0030.01414.73
7.3.100.0000.01314.69
7.3.90.0030.01015.02
7.3.80.0100.00314.91
7.3.70.0100.00314.84
7.3.60.0030.00915.11
7.3.50.0090.00915.08
7.3.40.0030.01315.01
7.3.30.0090.00315.07
7.3.20.0030.00917.04
7.3.10.0090.00616.85
7.3.00.0370.00915.88
7.2.330.0090.00916.86
7.2.320.0090.00916.64
7.2.310.0130.00316.82
7.2.300.0150.00916.82
7.2.290.0100.00516.89
7.2.250.0000.01915.47
7.2.240.0070.01115.15
7.2.230.0120.00615.21
7.2.220.0080.00415.14
7.2.210.0110.00015.07
7.2.200.0030.01415.04
7.2.190.0060.00915.09
7.2.180.0040.00715.38
7.2.170.0100.00615.21
7.2.130.0730.00615.15
7.2.120.1430.00715.10
7.2.110.1110.00015.05
7.2.100.0730.00315.25
7.2.90.1060.00315.42
7.2.80.1180.00715.27
7.2.70.1230.01015.21
7.2.60.0860.01415.19
7.2.50.0740.00615.33
7.2.40.1360.00315.17
7.2.30.1310.00015.09
7.2.20.0870.00715.25
7.2.10.0850.00315.33
7.2.00.0790.00315.14
7.1.330.0100.00716.05
7.1.320.0040.00916.13
7.1.310.0040.00815.81
7.1.300.0120.00615.73
7.1.290.0000.01415.96
7.1.280.0070.00716.04
7.1.270.0000.01416.17
7.1.260.0000.01415.99
7.1.250.0990.00414.25

preferences:
175.31 ms | 403 KiB | 5 Q