3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Hello {replace this curley} {{but not this one}} {{{and not this one}}}"; $formatted = preg_replace('/^(?!\\{{2,})(?:[^\\{]*)(\\{{1})(?:[^\\{\\}]*)(\\}{1})$/',"",$string); var_dump($formatted);

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.0120.00616.50
8.3.50.0140.00422.16
8.3.40.0110.00318.79
8.3.30.0130.00318.88
8.3.20.0080.00020.09
8.3.10.0030.00521.89
8.3.00.0080.00019.51
8.2.180.0130.00916.73
8.2.170.0110.00722.96
8.2.160.0070.00719.26
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0070.00022.43
8.2.120.0030.00626.35
8.2.110.0000.01019.39
8.2.100.0040.01117.66
8.2.90.0080.00017.74
8.2.80.0000.00817.97
8.2.70.0030.00517.75
8.2.60.0090.00017.75
8.2.50.0000.00818.10
8.2.40.0060.00320.51
8.2.30.0000.01019.27
8.2.20.0040.00417.88
8.2.10.0040.00418.15
8.2.00.0040.00418.13
8.1.280.0030.01725.92
8.1.270.0080.00023.87
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0090.00022.42
8.1.230.0050.00522.63
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0000.00818.71
8.1.160.0070.00022.20
8.1.150.0040.00418.89
8.1.140.0030.00519.53
8.1.130.0040.00417.72
8.1.120.0000.00717.60
8.1.110.0040.00417.53
8.1.100.0040.00417.43
8.1.90.0080.00017.51
8.1.80.0070.00017.36
8.1.70.0000.00717.57
8.1.60.0030.00517.55
8.1.50.0000.00817.62
8.1.40.0000.00817.61
8.1.30.0040.00417.73
8.1.20.0070.00017.71
8.1.10.0040.00417.53
8.1.00.0040.00417.45
8.0.300.0040.00420.04
8.0.290.0040.00416.75
8.0.280.0000.00818.40
8.0.270.0030.00317.11
8.0.260.0080.00017.21
8.0.250.0000.00717.06
8.0.240.0030.00316.99
8.0.230.0070.00016.98
8.0.220.0030.00316.94
8.0.210.0020.00517.03
8.0.200.0000.00617.02
8.0.190.0080.00017.02
8.0.180.0050.00216.99
8.0.170.0040.00416.90
8.0.160.0040.00416.88
8.0.150.0070.00016.93
8.0.140.0070.00016.95
8.0.130.0070.00013.39
8.0.120.0060.00316.82
8.0.110.0030.00416.99
8.0.100.0030.00716.79
8.0.90.0080.00017.01
8.0.80.0030.01316.89
8.0.70.0000.00716.84
8.0.60.0050.00316.91
8.0.50.0070.00016.84
8.0.30.0130.00717.27
8.0.20.0090.01317.40
8.0.10.0070.00017.13
8.0.00.0070.01016.82
7.4.330.0060.00015.08
7.4.320.0030.00316.75
7.4.300.0000.00616.79
7.4.290.0020.00516.76
7.4.280.0040.00416.68
7.4.270.0000.00616.60
7.4.260.0080.00016.74
7.4.250.0040.00416.64
7.4.240.0040.00416.64
7.4.230.0000.00816.70
7.4.220.0140.00616.69
7.4.210.0010.01416.73
7.4.200.0050.00216.56
7.4.160.0060.01016.36
7.4.150.0110.00717.40
7.4.140.0130.00817.86
7.4.130.0100.00916.59
7.4.120.0090.00816.61
7.4.110.0070.01016.76
7.4.100.0070.01016.65
7.4.90.0090.00916.57
7.4.80.0090.00919.39
7.4.70.0110.01016.36
7.4.60.0120.00316.63
7.4.50.0030.01216.47
7.4.40.0040.01216.58
7.4.30.0030.01316.51
7.4.00.0130.00315.14
7.3.330.0060.00013.04
7.3.320.0060.00013.19
7.3.310.0070.00016.26
7.3.300.0000.00716.15
7.3.290.0000.00716.30
7.3.280.0090.01016.28
7.3.270.0110.00717.40
7.3.260.0090.01216.35
7.3.250.0110.00616.36
7.3.240.0100.01116.33
7.3.230.0060.01216.39
7.3.210.0070.01016.25
7.3.200.0130.00716.51
7.3.190.0060.01016.42
7.3.180.0100.01016.57
7.3.170.0080.00816.71
7.3.160.0100.01316.45
7.2.330.0140.00316.79
7.2.320.0060.01216.76
7.2.310.0000.01716.55
7.2.300.0100.00616.70
7.2.290.0070.01016.72
7.2.00.0000.01419.57
7.1.70.0040.00417.25
7.1.60.0000.01119.63
7.1.00.0070.07322.30
7.0.200.0380.00314.77
7.0.80.0330.05720.19
7.0.70.0500.07320.03
7.0.60.0400.07019.84
7.0.50.0300.05720.39
7.0.40.0370.05320.32
7.0.30.0400.07020.39
7.0.20.0630.05020.33
7.0.10.0370.05020.33
7.0.00.0530.05720.44
5.6.280.0000.07721.07
5.6.230.0170.06020.80
5.6.220.0170.05720.58
5.6.210.0070.06020.85
5.6.200.0270.06021.10
5.6.190.0100.06021.17
5.6.180.0170.05321.01
5.6.170.0170.07021.13
5.6.160.0130.05721.02
5.6.150.0230.05021.10
5.6.140.0200.05320.98
5.6.130.0130.07321.08
5.6.120.0030.07021.01
5.6.110.0100.06021.01
5.6.100.0170.05321.07
5.6.90.0200.05321.11
5.6.80.0100.05720.44
5.6.70.0130.05320.54
5.6.60.0070.06020.45
5.6.50.0100.06020.47
5.6.40.0130.05320.49
5.6.30.0130.05320.46
5.6.20.0130.05320.45
5.6.10.0130.05720.43
5.6.00.0170.05320.40
5.5.370.0130.05320.46
5.5.360.0270.07020.49
5.5.350.0170.05720.42
5.5.340.0070.08320.97
5.5.330.0300.03720.83
5.5.320.0070.06320.70
5.5.310.0200.05720.67
5.5.300.0170.08320.88
5.5.290.0170.07720.82
5.5.280.0170.06020.95
5.5.270.0170.05320.91
5.5.260.0070.06720.87
5.5.250.0100.06020.64
5.5.240.0170.05020.27
5.5.230.0100.06020.32
5.5.220.0130.05320.07
5.5.210.0130.05320.30
5.5.200.0170.05020.20
5.5.190.0130.07020.32
5.5.180.0100.05720.18
5.5.160.0230.05720.18
5.5.150.0070.06020.24
5.5.140.0270.04020.29
5.5.130.0100.06020.27
5.5.120.0170.05020.26
5.5.110.0170.05020.26
5.5.100.0100.06020.01
5.5.90.0070.05720.13
5.5.80.0130.05020.09
5.5.70.0270.04320.05
5.5.60.0130.06020.07
5.5.50.0070.06019.99
5.5.40.0130.05019.99
5.5.30.0070.06019.98
5.5.20.0070.06020.11
5.5.10.0100.06020.10
5.5.00.0100.05719.96

preferences:
31.17 ms | 401 KiB | 5 Q