3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exp = '/[\s\S]*\{%[\s\S]*for[\s\S]*ad[\s\S]*in[\s\S]*ads[\s\S]*%\}/'; $string = "{% for ad in ads %} sdfksjf {% for ad in ads %} sdfksjf2 {% for ad in ads %} sdfksjf3"; function str_lreplace($search, $replace, $subject) { return preg_replace('~(.*)' . preg_quote($search, '~') . '~', '$1' . $replace, $subject, 1); } echo str_lreplace($exp,'',$string);

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.0040.01116.75
8.3.50.0110.00822.12
8.3.40.0070.01118.79
8.3.30.0090.00619.09
8.3.20.0050.00220.34
8.3.10.0050.00323.53
8.3.00.0050.00319.51
8.2.180.0150.00418.54
8.2.170.0170.00322.96
8.2.160.0140.00020.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00222.16
8.2.110.0030.00620.35
8.2.100.0090.00317.97
8.2.90.0000.00819.09
8.2.80.0000.00917.97
8.2.70.0000.00817.88
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0000.00919.95
8.2.30.0040.00419.88
8.2.20.0000.00817.73
8.2.10.0040.00418.11
8.2.00.0040.00717.91
8.1.280.0090.00925.92
8.1.270.0040.00422.18
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.05
8.1.230.0080.00417.57
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0000.00917.53
8.1.180.0000.01019.14
8.1.170.0070.00418.42
8.1.160.0050.00522.02
8.1.150.0050.00218.90
8.1.140.0060.00317.65
8.1.130.0030.00317.95
8.1.120.0050.00217.55
8.1.110.0000.00717.52
8.1.100.0070.00017.66
8.1.90.0030.00417.61
8.1.80.0050.00317.53
8.1.70.0030.00317.45
8.1.60.0070.00317.68
8.1.50.0030.00517.60
8.1.40.0030.00517.66
8.1.30.0040.00417.68
8.1.20.0030.00717.85
8.1.10.0000.00817.51
8.1.00.0030.00617.62
8.0.300.0080.00018.77
8.0.290.0080.00016.75
8.0.280.0070.00018.51
8.0.270.0020.00517.21
8.0.260.0040.00417.29
8.0.250.0040.00417.14
8.0.240.0080.00017.14
8.0.230.0090.00017.00
8.0.220.0000.00617.07
8.0.210.0040.00417.05
8.0.200.0000.00716.98
8.0.190.0050.00317.10
8.0.180.0040.00417.11
8.0.170.0040.00417.01
8.0.160.0000.00716.96
8.0.150.0020.00516.91
8.0.140.0000.00716.90
8.0.130.0000.00613.49
8.0.120.0000.00817.07
8.0.110.0000.00817.08
8.0.100.0070.00016.95
8.0.90.0000.00717.02
8.0.80.0130.00317.00
8.0.70.0030.00517.15
8.0.60.0040.00416.97
8.0.50.0000.00816.98
8.0.30.0110.00817.35
8.0.20.0140.00517.40
8.0.10.0040.00417.01
8.0.00.0080.01017.04
7.4.330.0020.00215.00
7.4.320.0030.00316.68
7.4.300.0030.00316.84
7.4.290.0070.00316.75
7.4.280.0000.00816.87
7.4.270.0000.00716.66
7.4.260.0030.00316.72
7.4.250.0000.00816.70
7.4.240.0050.00316.84
7.4.230.0040.00416.91
7.4.220.0070.02016.79
7.4.210.0020.01316.73
7.4.200.0000.00816.63
7.4.190.0050.00217.00
7.4.160.0100.00516.68
7.4.150.0070.01117.40
7.4.140.0100.00917.86
7.4.130.0090.00716.67
7.4.120.0070.01316.59
7.4.110.0110.00716.51
7.4.100.0100.01316.72
7.4.90.0140.00316.72
7.4.80.0100.00719.39
7.4.70.0090.01016.48
7.4.60.0070.01316.77
7.4.50.0050.00316.64
7.4.40.0060.00922.77
7.4.30.0000.01616.83
7.4.00.0030.00715.24
7.3.330.0030.00313.24
7.3.320.0000.00513.53
7.3.310.0000.00716.46
7.3.300.0000.00716.34
7.3.290.0040.01016.46
7.3.280.0100.01016.45
7.3.270.0040.01317.40
7.3.260.0120.00616.72
7.3.250.0100.01016.66
7.3.240.0040.01316.53
7.3.230.0100.00616.76
7.3.210.0110.00616.55
7.3.200.0120.00619.39
7.3.190.0070.01016.61
7.3.180.0090.00916.79
7.3.170.0090.00616.55
7.3.160.0090.00616.79
7.3.120.0070.01014.99
7.3.10.0090.00216.64
7.3.00.0080.00516.76
7.2.330.0070.01116.73
7.2.320.0120.00616.84
7.2.310.0150.00316.84
7.2.300.0040.01216.58
7.2.290.0060.01716.73
7.2.130.0030.01017.13
7.2.120.0060.00716.72
7.2.110.0030.01016.87
7.2.100.0080.00616.96
7.2.90.0150.00216.76
7.2.80.0120.00616.65
7.2.70.0110.00316.69
7.2.60.0100.00817.11
7.2.50.0170.00616.96
7.2.40.0090.00916.77
7.2.30.0130.01117.10
7.2.20.0150.00617.08
7.2.10.0150.00316.96
7.2.00.0080.00818.36
7.1.250.0110.00715.69
7.1.200.0000.00616.09
7.1.100.0100.00718.48
7.1.70.0030.00917.34
7.1.60.0070.01119.46
7.1.50.0040.01816.92
7.1.00.0000.08022.49
7.0.200.0070.00417.08
7.0.140.0030.07022.01
7.0.60.0100.07720.02
7.0.50.0200.05017.77
7.0.40.0130.04020.22
7.0.30.0170.06320.14
7.0.20.0200.04720.31
7.0.10.0070.08720.34
7.0.00.0070.04720.16
5.6.280.0000.07720.91
5.6.210.0070.08020.73
5.6.200.0100.08318.15
5.6.190.0070.08720.67
5.6.180.0200.03720.50
5.6.170.0300.05320.45
5.6.160.0100.08020.51
5.6.150.0070.03718.29
5.6.140.0070.07718.18
5.6.130.0000.06018.18
5.6.120.0130.08021.01
5.6.110.0070.08320.98
5.6.100.0030.04021.12
5.6.90.0100.05021.11
5.6.80.0000.04320.40
5.6.70.4400.03720.39
5.5.350.0270.06320.41
5.5.340.0100.08018.08
5.5.330.0000.04320.32
5.5.320.0070.05320.21
5.5.310.0230.05320.36
5.5.300.0070.06018.13
5.5.290.0100.04717.99
5.5.280.0130.07720.87
5.5.270.0030.04020.83
5.5.260.0130.08320.77
5.5.250.0030.08720.58
5.5.240.0170.06720.27
5.4.450.0600.05719.45
5.4.440.0630.06719.48
5.4.430.0630.05019.61
5.4.420.0670.00019.42
5.4.410.0070.06018.69
5.4.400.0230.05318.82
5.4.390.0370.04718.73
5.4.380.0170.05718.79
5.4.370.0100.05318.59
5.4.360.0100.05018.74
5.4.350.0020.04112.02
5.4.340.0080.03612.02
5.4.320.0080.03612.51
5.4.310.0070.03912.50
5.4.300.0050.03712.50
5.4.290.0040.05512.49
5.4.280.0070.04012.39
5.4.270.0060.04312.39
5.4.260.0100.06112.39
5.4.250.0110.04712.39
5.4.240.0090.05612.39
5.4.230.0160.07812.38
5.4.220.0090.08212.38
5.4.210.0160.06912.38
5.4.200.0120.07112.38
5.4.190.0130.06312.38
5.4.180.0120.06512.38
5.4.170.0090.05712.39
5.4.160.0090.05712.38
5.4.150.0100.05212.38
5.4.140.0080.05712.07
5.4.130.0090.04812.05
5.4.120.0080.04012.00
5.4.110.0110.05912.01
5.4.100.0090.04312.00
5.4.90.0090.05012.00
5.4.80.0090.05312.00
5.4.70.0090.05212.00
5.4.60.0080.05212.00
5.4.50.0080.04112.00
5.4.40.0100.04811.99
5.4.30.0060.03911.98
5.4.20.0090.04811.98
5.4.10.0070.03911.98
5.4.00.0120.04811.48
5.3.290.0060.03912.80
5.3.280.0100.04812.71
5.3.270.0070.05212.73
5.3.260.0060.05912.72
5.3.250.0070.06212.72
5.3.240.0070.05412.72
5.3.230.0150.07212.71
5.3.220.0140.05512.68
5.3.210.0100.05512.68
5.3.200.0050.05312.68
5.3.190.0140.04212.68
5.3.180.0110.05112.68
5.3.170.0050.04712.67
5.3.160.0110.04912.67
5.3.150.0100.06212.68
5.3.140.0040.04312.66
5.3.130.0100.04112.66
5.3.120.0070.05512.66
5.3.110.0060.04312.65
5.3.100.0060.04212.12
5.3.90.0100.03512.11
5.3.80.0090.03612.10
5.3.70.0050.03712.11
5.3.60.0030.04012.09
5.3.50.0110.04112.04
5.3.40.0130.06012.04
5.3.30.0100.04411.99
5.3.20.0130.04511.77
5.3.10.0060.04111.74
5.3.00.0070.04711.73
5.2.170.0060.0409.23
5.2.160.0060.0409.23
5.2.150.0130.0409.23
5.2.140.0110.0469.23
5.2.130.0080.0469.19
5.2.120.0130.0379.19
5.2.110.0090.0449.20
5.2.100.0090.0389.19
5.2.90.0080.0409.18
5.2.80.0120.0679.18
5.2.70.0070.0389.18
5.2.60.0090.0289.14
5.2.50.0040.0359.11
5.2.40.0100.0479.09
5.2.30.0120.0749.06
5.2.20.0060.0379.05
5.2.10.0080.0348.94
5.2.00.0090.0368.80
5.1.60.0070.0318.09
5.1.50.0020.0298.09
5.1.40.0080.0268.06
5.1.30.0060.0308.41
5.1.20.0020.0358.43
5.1.10.0040.0288.16
5.1.00.0070.0338.16
5.0.50.0050.0236.64
5.0.40.0030.0226.50
5.0.30.0040.0326.31
5.0.20.0040.0206.28
5.0.10.0060.0186.25
5.0.00.0040.0326.25
4.4.90.0040.0214.77
4.4.80.0070.0394.76
4.4.70.0060.0224.76
4.4.60.0060.0204.75
4.4.50.0060.0224.77
4.4.40.0050.0424.71
4.4.30.0040.0244.76
4.4.20.0040.0254.84
4.4.10.0020.0294.85
4.4.00.0010.0284.76
4.3.110.0040.0164.67
4.3.100.0030.0184.67
4.3.90.0020.0184.63
4.3.80.0020.0294.58
4.3.70.0050.0574.63
4.3.60.0030.0344.63
4.3.50.0040.0214.63
4.3.40.0040.0344.54
4.3.30.0110.0333.30
4.3.20.0010.0213.28
4.3.10.0030.0163.24
4.3.00.0130.0207.04

preferences:
49.78 ms | 401 KiB | 5 Q