3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/@if\h*(\(((?:[^()]++|(?1))*)\))\s*(.*?)\s*@endif\b/is'; $s = '@if(!empty($title))test and testing@endif'; $subst = "<?php if($2) { ?>$3<?php } ?>"; $result = preg_replace($pattern, $subst, $s); echo $result;

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.0110.00620.16
8.5.00.0130.00920.32
8.4.150.0030.00014.05
8.4.140.0110.01017.86
8.4.130.0110.00917.95
8.4.120.0060.00520.61
8.4.110.0140.00718.61
8.4.100.0110.00917.80
8.4.90.0130.00718.16
8.4.80.0090.00917.81
8.4.70.0090.00617.83
8.4.60.0080.01318.83
8.4.50.0130.00817.84
8.4.40.0130.00317.75
8.4.30.0200.00020.54
8.4.20.0130.00724.06
8.4.10.0060.00323.73
8.3.280.0140.00818.46
8.3.270.0130.00616.66
8.3.260.0090.01016.52
8.3.250.0130.00516.96
8.3.240.0130.00616.68
8.3.230.0100.00816.51
8.3.220.0070.01017.08
8.3.210.0110.00616.63
8.3.200.0060.00316.85
8.3.190.0110.00817.24
8.3.180.0110.00718.61
8.3.170.0150.00419.03
8.3.160.0180.00018.71
8.3.150.0090.00918.93
8.3.140.0040.00416.48
8.3.130.0110.00716.64
8.3.120.0060.00318.80
8.3.110.0030.00620.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0090.00017.97
8.3.70.0110.00716.88
8.3.60.0040.01116.50
8.3.50.0160.00616.66
8.3.40.0070.00720.04
8.3.30.0110.00418.88
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0080.00026.16
8.2.290.0110.00819.02
8.2.280.0070.00118.59
8.2.270.0070.01116.80
8.2.260.0080.00018.91
8.2.250.0030.00618.70
8.2.240.0040.00417.20
8.2.230.0090.00022.58
8.2.220.0030.00537.54
8.2.210.0040.00426.77
8.2.200.0000.01117.00
8.2.190.0110.00416.58
8.2.180.0140.00716.75
8.2.170.0130.01018.96
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0090.00322.42
8.2.100.0000.01217.91
8.2.90.0030.00617.84
8.2.80.0000.00819.89
8.2.70.0060.00317.88
8.2.60.0050.00317.59
8.2.50.0060.00317.63
8.2.40.0090.00917.62
8.2.30.0140.00517.62
8.2.20.0110.00517.63
8.2.10.0040.01217.73
8.2.00.0130.00317.62
8.1.330.0150.00916.44
8.1.320.0090.01116.15
8.1.310.0060.00316.76
8.1.300.0070.00316.44
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0080.00024.66
8.1.260.0050.00526.35
8.1.250.0070.00028.09
8.1.240.0060.00323.89
8.1.230.0070.00420.96
8.1.220.0040.00417.74
8.1.210.0100.00018.77
8.1.200.0050.00317.47
8.1.190.0050.00517.13
8.1.180.0040.00418.10
8.1.170.0100.00717.62
8.1.160.0070.01017.62
8.1.150.0100.00617.62
8.1.140.0120.00417.62
8.1.130.0130.00317.62
8.1.120.0120.00417.62
8.1.110.0110.00617.62
8.1.100.0140.00417.62
8.1.90.0110.00417.62
8.1.80.0120.00417.62
8.1.70.0170.00017.62
8.1.60.0060.01317.62
8.1.50.0130.00417.62
8.1.40.0130.00417.63
8.1.30.0140.00417.62
8.1.20.0150.00417.63
8.1.10.0120.00617.62
8.1.00.0120.00517.62
8.0.300.0080.00020.07
8.0.290.0040.00416.75
8.0.280.0170.00017.62
8.0.270.0180.00017.62
8.0.260.0130.00417.62
8.0.250.0100.00717.62
8.0.240.0120.00517.62
8.0.230.0060.01117.62
8.0.220.0130.00317.62
8.0.210.0130.00317.62
8.0.200.0150.00017.62
8.0.190.0080.00817.62
8.0.180.0130.00417.62
8.0.170.0170.00017.62
8.0.160.0140.00317.62
8.0.150.0140.00317.62
8.0.140.0090.00917.62
8.0.130.0130.00317.62
8.0.120.0100.00717.62
8.0.110.0180.00417.62
8.0.100.0140.00317.62
8.0.90.0150.00017.62
8.0.80.0120.00417.62
8.0.70.0030.01317.62
8.0.60.0140.00017.62
8.0.50.0100.00617.62
8.0.30.0090.00617.62
8.0.20.0130.00317.62
8.0.10.0110.00517.62

preferences:
114.6 ms | 403 KiB | 5 Q