3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'Other text1 {r|url-slug1|LinkTitle1} Other text2 {t|url-slug2|LinkTitle2} Other text3'; $pattern = '~ (?<before> .*? ) { (?: r (*MARK:ref) | t (*MARK:type) ) \Q|\E (?<url_slug> [^|]+ ) \Q|\E (?<linkTitle> [^}]+ ) } | (?<after> .+ ) ~xs'; preg_match_all($pattern, $s, $matches, PREG_SET_ORDER); $res = array_reduce($matches, fn($c, $i) => $c . ( $i['after'] ?? $i['before'] . '<a href="/' . $i['MARK'] . '/' . $i['url_slug']. '">' . $i['linkTitle'] . '</a>' ) ); echo $res;

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.30.0120.00619.48
8.5.20.0120.00519.50
8.5.10.0090.00917.06
8.5.00.0110.01120.28
8.4.180.0130.00823.80
8.4.170.0140.01023.87
8.4.160.0150.00623.96
8.4.150.0080.00516.96
8.4.140.0120.00817.83
8.4.130.0100.01117.89
8.4.120.0130.00820.34
8.4.110.0060.00522.52
8.4.100.0130.00818.00
8.4.90.0110.01019.04
8.4.80.0100.00317.82
8.4.70.0090.00817.95
8.4.60.0050.00419.05
8.4.50.0100.00919.79
8.4.40.0110.01119.98
8.4.30.0060.00918.82
8.4.20.0070.01418.59
8.4.10.0090.00017.82
8.3.300.0120.00820.82
8.3.290.0140.00718.71
8.3.280.0110.00918.66
8.3.270.0130.00616.68
8.3.260.0080.01016.80
8.3.250.0100.00918.69
8.3.240.0120.00816.47
8.3.230.0110.00716.82
8.3.220.0030.00416.98
8.3.210.0090.00316.78
8.3.200.0050.00416.92
8.3.190.0040.00418.95
8.3.180.0050.00318.30
8.3.170.0090.00618.94
8.3.160.0160.00317.04
8.3.150.0080.01220.73
8.3.140.0040.00420.62
8.3.130.0040.00418.50
8.3.120.0070.01019.05
8.3.110.0080.00020.94
8.3.100.0090.00016.75
8.3.90.0120.00326.77
8.3.80.0030.00619.36
8.3.70.0130.00916.73
8.3.60.0120.00316.75
8.3.50.0140.00716.23
8.3.40.0060.00918.96
8.3.30.0040.01118.79
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.300.0120.00718.32
8.2.290.0100.00420.76
8.2.280.0120.01018.87
8.2.270.0160.00317.20
8.2.260.0040.01416.85
8.2.250.0040.00418.42
8.2.240.0130.00319.19
8.2.230.0030.00622.58
8.2.220.0070.00324.06
8.2.210.0000.00726.77
8.2.200.0040.00418.88
8.2.190.0140.00716.75
8.2.180.0090.01225.92
8.2.170.0090.00619.09
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.91
8.2.110.0060.00322.24
8.2.100.0090.00317.97
8.2.90.0000.00917.88
8.2.80.0030.00518.80
8.2.70.0030.00517.75
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0000.00718.16
8.2.20.0000.00718.18
8.2.10.0050.00319.23
8.2.00.0000.00719.43
8.1.340.0120.00917.95
8.1.330.0050.00622.07
8.1.320.0100.00916.20
8.1.310.0060.00316.64
8.1.300.0110.00417.98
8.1.290.0060.00330.84
8.1.280.0120.00325.92
8.1.270.0070.01322.02
8.1.260.0050.00228.09
8.1.250.0080.00028.09
8.1.240.0060.00324.05
8.1.230.0120.00017.67
8.1.220.0050.00317.78
8.1.210.0030.00518.77
8.1.200.0030.00617.47
8.1.190.0030.00517.35
8.1.180.0000.00818.10
8.1.170.0040.00418.73
8.1.160.0040.00419.05
8.1.150.0000.00718.99
8.1.140.0030.00618.82
8.1.130.0000.00720.17
8.1.120.0030.00617.65
8.1.110.0030.00617.54
8.1.100.0040.00417.53
8.1.90.0000.00717.55
8.1.80.0000.00817.52
8.1.70.0030.00317.68
8.1.60.0040.00417.75
8.1.50.0040.00417.66
8.1.40.0060.00317.62
8.1.30.0000.00817.72
8.1.20.0040.00417.86
8.1.10.0040.00417.68
8.1.00.0040.00417.70
8.0.300.0080.00018.93
8.0.290.0090.00016.75
8.0.280.0100.00018.52
8.0.270.0000.00718.09
8.0.260.0070.00018.64
8.0.250.0000.00717.00
8.0.240.0040.00416.99
8.0.230.0040.00417.07
8.0.220.0000.00716.99
8.0.210.0080.00017.05
8.0.200.0030.00517.09
8.0.190.0030.00517.00
8.0.180.0040.00417.05
8.0.170.0030.00617.08
8.0.160.0000.00717.14
8.0.150.0040.00416.98
8.0.140.0000.00716.97
8.0.130.0030.00313.43
8.0.120.0040.00417.07
8.0.110.0050.00217.03
8.0.100.0040.00417.09
8.0.90.0040.00416.84
8.0.80.0100.00817.01
8.0.70.0000.00816.95
8.0.60.0000.00716.93
8.0.50.0070.00017.08
8.0.30.0070.00717.01
8.0.20.0070.00717.16
8.0.10.0070.01417.16
8.0.00.0070.01017.13
7.4.330.0020.00215.55
7.4.320.0030.00316.75
7.4.300.0000.00716.63
7.4.290.0080.00016.75
7.4.280.0050.00316.64
7.4.270.0040.00416.88
7.4.260.0030.00313.51
7.4.250.0070.00016.59
7.4.240.0020.00616.83
7.4.230.0070.00016.80
7.4.220.0000.00716.73
7.4.210.0130.00716.84
7.4.200.0000.00716.93
7.4.160.0070.00716.84
7.4.150.0070.00716.84
7.4.140.0130.00716.77
7.4.130.0060.00816.60
7.4.120.0030.01416.67
7.4.110.0070.00716.88
7.4.100.0070.00716.76
7.4.90.0000.01416.70
7.4.80.0060.00916.64
7.4.70.0040.01516.84
7.4.60.0100.00316.93
7.4.50.0060.00916.64
7.4.40.0070.01016.78
7.4.30.0090.00616.92
7.4.20.0070.00716.79
7.4.10.0090.01216.81
7.4.00.0060.01016.82
7.3.330.0000.00716.13
7.3.320.0030.00313.22
7.3.310.0030.00316.24
7.3.300.0060.00016.13
7.3.290.0080.00716.17
7.3.280.0060.00616.20
7.3.270.0070.00716.19
7.3.260.0080.00616.14
7.3.250.0110.00316.17
7.3.240.0080.00816.20
7.3.230.0100.00316.20
7.3.220.0090.00616.14
7.3.210.0070.00716.06
7.3.200.0090.00616.05
7.3.190.0040.01116.12
7.3.180.0060.00616.00
7.3.170.0100.00316.07
7.3.160.0030.01416.14
7.3.150.0090.00316.11
7.3.140.0040.00816.12
7.3.130.0060.00616.05
7.3.120.0090.00916.06
7.3.110.0000.01316.07
7.3.100.0100.01016.09
7.3.90.0090.00916.40
7.3.80.0100.01016.07
7.3.70.0060.01216.04
7.3.60.0110.00816.16
7.3.50.0070.00716.18
7.3.40.0060.01216.24
7.3.30.0030.01016.14
7.3.20.0070.01316.23
7.3.10.0140.00316.05
7.3.00.0030.01016.27

preferences:
110.9 ms | 1390 KiB | 5 Q