3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Some text at the start {{if|service_name=DJ Booth}} This is the text for DJs {{endif}} Some text in the middle {{if|service_name=Dancefloor Hire}} This is the text for dancefloor hire {{endif}} Some text at the end'; $service = "Dancefloor Hire"; echo preg_replace(["/{{if\|service_name=$service}}\s*(.*?)\R{{endif}}/s", "/\R?{{if.*?}}.*?{{endif}}\R?/s"], ["$1", ""], $text);

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.4.120.0020.00623.99
8.4.110.0100.01118.79
8.4.100.0150.00618.56
8.4.90.0120.00820.66
8.4.80.0110.01019.77
8.4.70.0080.00318.16
8.4.60.0080.01320.64
8.4.50.0040.00518.70
8.4.40.0060.01017.96
8.4.30.0000.01017.61
8.4.20.0030.01320.62
8.4.10.0090.00017.98
8.3.250.0100.00918.95
8.3.240.0060.00317.10
8.3.230.0050.00916.66
8.3.220.0050.00218.62
8.3.210.0150.00616.78
8.3.200.0060.00316.72
8.3.190.0090.00717.41
8.3.180.0130.00718.34
8.3.170.0110.00716.98
8.3.160.0030.01018.16
8.3.150.0120.00616.93
8.3.140.0080.00016.85
8.3.130.0000.01018.49
8.3.120.0100.01019.05
8.3.110.0040.00720.94
8.3.100.0100.00024.06
8.3.90.0040.01126.77
8.3.80.0060.00317.97
8.3.70.0070.01418.59
8.3.60.0090.00918.30
8.3.50.0140.00218.34
8.3.40.0130.00318.92
8.3.30.0040.01118.97
8.3.20.0030.00518.89
8.3.10.0000.00821.91
8.3.00.0030.00523.50
8.2.290.0140.00620.66
8.2.280.0130.00718.21
8.2.270.0090.00917.30
8.2.260.0030.00920.37
8.2.250.0060.00318.54
8.2.240.0130.00619.04
8.2.230.0040.00422.58
8.2.220.0130.00337.54
8.2.210.0000.00826.77
8.2.200.0000.00916.88
8.2.190.0120.00316.84
8.2.180.0130.00916.48
8.2.170.0090.00622.96
8.2.160.0090.00622.38
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00421.06
8.2.120.0000.00826.35
8.2.110.0090.00021.12
8.2.100.0000.01117.97
8.2.90.0080.00017.88
8.2.80.0030.00619.09
8.2.70.0040.00917.75
8.2.60.0040.00417.93
8.2.50.0050.00318.05
8.2.40.0030.00619.72
8.2.30.0000.00722.59
8.2.20.0070.00018.07
8.2.10.0030.00518.07
8.2.00.0030.00518.29
8.1.330.0050.00522.18
8.1.320.0090.01116.40
8.1.310.0120.00318.60
8.1.300.0090.00018.60
8.1.290.0090.00030.84
8.1.280.0000.01625.92
8.1.270.0050.00320.25
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.01021.95
8.1.230.0070.00420.98
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.48
8.1.190.0000.00817.36
8.1.180.0060.00319.26
8.1.170.0080.00018.78
8.1.160.0000.00818.86
8.1.150.0000.00818.70
8.1.140.0050.00319.02
8.1.130.0070.00020.30
8.1.120.0040.00417.62
8.1.110.0040.00417.68
8.1.100.0000.00717.50
8.1.90.0000.00817.64
8.1.80.0030.00517.64
8.1.70.0000.00717.65
8.1.60.0040.00417.61
8.1.50.0030.00617.71
8.1.40.0030.00717.68
8.1.30.0090.00017.72
8.1.20.0050.00317.76
8.1.10.0040.00417.66
8.1.00.0080.00017.58
8.0.300.0080.00018.81
8.0.290.0040.00416.88
8.0.280.0000.00718.48
8.0.270.0040.00417.29
8.0.260.0030.00318.47
8.0.250.0070.00017.14
8.0.240.0030.00517.13
8.0.230.0080.00017.00
8.0.220.0030.00416.98
8.0.210.0000.00717.09
8.0.200.0070.00017.09
8.0.190.0080.00017.13
8.0.180.0040.00417.08
8.0.170.0040.00416.96
8.0.160.0040.00417.01
8.0.150.0000.00817.10
8.0.140.0070.00017.02
8.0.130.0000.00513.46
8.0.120.0030.00716.87
8.0.110.0040.00416.88
8.0.100.0070.00016.85
8.0.90.0000.00717.01
8.0.80.0070.00917.01
8.0.70.0030.00517.09
8.0.60.0020.00517.08
8.0.50.0040.00416.93
8.0.30.0150.00517.25
8.0.20.0210.01117.40
8.0.10.0040.00417.22
8.0.00.0080.01016.89
7.4.330.0030.00315.55
7.4.320.0030.00316.77
7.4.300.0030.00316.87
7.4.290.0000.00716.62
7.4.280.0060.00316.84
7.4.270.0030.00516.62
7.4.260.0040.00416.88
7.4.250.0070.00016.73
7.4.240.0040.00416.73
7.4.230.0050.00216.63
7.4.220.0040.00416.85
7.4.210.0080.00716.64
7.4.200.0030.00316.63
7.4.160.0060.01016.69
7.4.140.0110.01017.86
7.4.130.0130.01016.77
7.4.120.0100.01016.71
7.4.110.0000.01616.55
7.4.100.0130.00616.73
7.4.90.0130.00816.91
7.4.80.0150.00319.39
7.4.70.0140.00317.03
7.4.60.0040.01416.67
7.4.50.0140.00416.54
7.4.40.0090.01316.73
7.4.00.0060.01215.14
7.3.330.0000.00513.32
7.3.320.0000.00513.32
7.3.310.0070.00016.23
7.3.300.0030.00316.42
7.3.290.0070.00016.34
7.3.280.0100.00516.40
7.3.260.0140.00416.55
7.3.240.0130.00516.59
7.3.230.0120.00916.42
7.3.210.0040.01316.38
7.3.200.0100.00716.38
7.3.190.0110.00516.54
7.3.180.0090.01216.35
7.3.170.0130.00316.73
7.3.160.0100.00716.59
7.3.10.0090.00316.59
7.3.00.0030.01116.37
7.2.330.0090.00916.74
7.2.320.0110.01116.73
7.2.310.0100.00616.77
7.2.300.0070.01616.63
7.2.290.0060.01116.75
7.2.130.0120.00616.93
7.2.120.0090.00416.98
7.2.110.0070.01016.65
7.2.100.3570.00715.75
7.2.90.3380.00715.87
7.2.80.2650.01415.67
7.2.70.1550.00615.97
7.2.60.0400.00315.80
7.2.50.0330.00815.90
7.2.40.1550.01016.08
7.2.30.0570.00515.89
7.2.20.0560.00615.96
7.2.10.0290.00615.88
7.2.00.0570.00515.99
7.1.250.0140.00315.83
7.1.220.9080.00713.98
7.1.210.6220.00913.75
7.1.200.5520.00314.11
7.1.190.3100.01014.19
7.1.180.0180.00714.14
7.1.170.0170.00713.79
7.1.160.0160.01213.99
7.1.150.2220.00614.09
7.1.140.0790.01614.12
7.1.130.0480.00713.99
7.1.120.1240.01213.78
7.1.110.4920.01014.12
7.1.100.4720.01314.16
7.1.90.3120.00314.17
7.1.80.1800.00314.12
7.1.70.0150.00413.86
7.1.60.0580.00632.15
7.1.50.0330.01032.31
7.1.40.0270.02032.05
7.1.30.0240.01032.13
7.1.20.0330.01032.14
7.1.10.0110.01314.09
7.1.00.5370.00013.91
5.6.380.0090.00914.17

preferences:
28.07 ms | 403 KiB | 5 Q