3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <html> <head><HEADER/></head> <body> <ul> <li><a href="page2">page2</a> </li> </ul> <CONTENT/> </body> <FOOTER/> </html> XML; $content = "<div id='main'>asdf asdf</div>"; $header = "<title>page 1</title>"; $footer = "<script type='text/javascript'></script>"; $doc = new DOMDocument(); $doc->loadXML($xml); $xp = new DOMXPath($doc); $ctag = $doc->getElementsByTagName("CONTENT")->item(0); $ctag->parentNode->replaceChild(new DOMCdataSection($content),$ctag); echo $doc->saveHTML();

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.0130.00718.68
8.3.50.0120.00922.10
8.3.40.0070.00719.09
8.3.30.0070.00719.09
8.3.20.0040.00418.92
8.3.10.0060.00320.79
8.3.00.0080.00417.88
8.2.180.0130.00317.13
8.2.170.0090.00622.96
8.2.160.0000.01422.63
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0040.01120.45
8.2.110.0100.00021.41
8.2.100.0120.00018.28
8.2.90.0040.00419.54
8.2.80.0050.00318.30
8.2.70.0030.00617.88
8.2.60.0030.00618.41
8.2.50.0000.00818.07
8.2.40.0000.00820.38
8.2.30.0040.00420.13
8.2.20.0040.00417.97
8.2.10.0040.00418.04
8.2.00.0030.00518.18
8.1.280.0080.00825.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00922.79
8.1.230.0040.00721.28
8.1.220.0000.00918.77
8.1.210.0000.00819.20
8.1.200.0030.00617.63
8.1.190.0060.00317.78
8.1.180.0050.00318.10
8.1.170.0080.00019.22
8.1.160.0000.00819.20
8.1.150.0040.00418.90
8.1.140.0080.00017.71
8.1.130.0080.00018.21
8.1.120.0050.00317.89
8.1.110.0050.00517.75
8.1.100.0040.00317.61
8.1.90.0000.00817.84
8.1.80.0030.00517.84
8.1.70.0040.00417.82
8.1.60.0000.00917.77
8.1.50.0040.00417.81
8.1.40.0000.00817.89
8.1.30.0040.00417.97
8.1.20.0030.00517.95
8.1.10.0040.00417.83
8.1.00.0000.00717.76
8.0.300.0000.00820.18
8.0.290.0040.00417.25
8.0.280.0030.00318.76
8.0.270.0040.00417.60
8.0.260.0040.00517.25
8.0.250.0040.00417.36
8.0.240.0000.00817.44
8.0.230.0100.00017.27
8.0.220.0030.00317.30
8.0.210.0070.00017.36
8.0.200.0040.00417.17
8.0.190.0000.00717.41
8.0.180.0040.00417.37
8.0.170.0030.00617.25
8.0.160.0040.00417.14
8.0.150.0030.00617.12
8.0.140.0070.00417.30
8.0.130.0060.00013.68
8.0.120.0000.00717.19
8.0.110.0070.00017.24
8.0.100.0040.00417.23
8.0.90.0040.00417.23
8.0.80.0030.01317.22
8.0.70.0000.00717.32
8.0.60.0040.00417.09
8.0.50.0040.00417.36
8.0.30.0120.00717.42
8.0.20.0090.00917.46
8.0.10.0040.00417.23
8.0.00.0090.01217.06
7.4.330.0050.00015.03
7.4.320.0000.00616.81
7.4.300.0030.00316.84
7.4.290.0040.00416.80
7.4.280.0050.00316.83
7.4.270.0030.00316.97
7.4.260.0050.00013.65
7.4.250.0040.00416.93
7.4.240.0000.00716.84
7.4.230.0030.00316.73
7.4.220.0120.00616.76
7.4.210.0110.00516.89
7.4.200.0000.00716.91
7.4.190.0040.00316.77
7.4.160.0120.00316.91
7.4.150.0080.01217.40
7.4.140.0110.00817.34
7.4.130.0130.00916.81
7.4.120.0110.00516.82
7.4.110.0040.01516.97
7.4.100.0040.01316.98
7.4.90.0060.01216.84
7.4.80.0130.00319.03
7.4.70.0130.00616.84
7.4.60.0120.00316.89
7.4.50.0020.00216.75
7.4.40.0120.00722.27
7.4.30.0100.00616.74
7.4.00.0100.00615.09
7.3.330.0030.00313.46
7.3.320.0000.00613.46
7.3.310.0000.00816.41
7.3.300.0070.00016.57
7.3.290.0070.00716.64
7.3.280.0110.00516.62
7.3.270.0150.00317.40
7.3.260.0100.01218.24
7.3.250.0170.00216.72
7.3.240.0130.00316.58
7.3.230.0070.01416.84
7.3.210.0160.00016.58
7.3.200.0060.01219.39
7.3.190.0110.01216.54
7.3.180.0100.00716.64
7.3.170.0120.01116.90
7.3.160.0150.00616.94
7.3.120.0090.00614.84
7.3.10.0070.01016.57
7.3.00.0030.01216.57
7.2.330.0080.01117.09
7.2.320.0090.00917.13
7.2.310.0110.00717.13
7.2.300.0060.01017.06
7.2.290.0030.01316.60
7.2.130.0080.00416.93
7.2.120.0000.01216.93
7.2.110.0000.01416.96
7.2.100.0110.00416.87
7.2.90.0030.00717.05
7.2.80.0030.01216.96
7.2.70.0100.00017.04
7.2.60.0070.00716.89
7.2.50.0070.00717.02
7.2.40.0050.00517.23
7.2.30.0030.00716.99
7.2.20.0030.00916.97
7.2.10.0030.00917.12
7.2.00.0050.00818.31
7.1.250.0040.00415.86
7.1.100.0900.01016.32
7.1.70.0100.00017.33
7.1.60.0100.01319.40
7.1.50.0030.01017.07
7.1.00.0030.07022.48
7.0.200.0070.00414.84
7.0.140.0070.07022.31
7.0.60.0370.07320.14
7.0.50.0000.08018.02
7.0.40.0130.04320.49
7.0.30.0370.07020.37
7.0.20.0200.05320.45
7.0.10.0000.09720.38
7.0.00.0070.04320.48
5.6.280.0070.07021.13
5.6.210.0030.05021.00
5.6.200.0100.04718.37
5.6.190.0170.07320.51
5.6.180.0330.07720.89
5.6.170.0330.06020.60
5.6.160.0030.04320.74
5.6.150.0070.08018.39
5.6.140.0230.04318.41
5.6.130.0000.04318.30
5.6.120.0070.04021.12
5.6.110.0100.08721.26
5.6.100.0130.07721.19
5.6.90.0030.04021.29
5.6.80.0100.07320.71
5.5.350.4100.04020.70
5.5.340.0070.03718.17
5.5.330.0070.07020.68
5.5.320.0570.07020.55
5.5.310.0330.05320.38
5.5.300.0100.08018.16
5.5.290.0030.04318.19
5.5.280.0100.04721.09
5.5.270.0100.07320.91
5.5.260.0130.05720.83
5.5.250.0030.04320.75
5.5.240.0070.07320.33
5.4.450.4300.03319.70
5.4.440.0070.07719.63
5.4.430.1400.04719.46
5.4.420.3700.04319.65
5.4.410.3870.04719.39
5.4.400.3900.03319.38
5.4.390.3870.04019.30
5.4.380.3830.03319.03
5.4.370.3070.03719.14
5.4.360.3970.04019.28
5.4.350.3530.03319.30
5.4.340.3570.03319.43
5.4.320.3600.03719.04
5.4.310.3830.04319.33
5.4.300.3630.03319.32
5.4.290.3730.04319.33
5.4.280.3600.04319.18
5.4.270.3730.04019.03
5.4.260.3800.03719.27
5.4.250.3630.04019.32
5.4.240.3830.04019.39
5.4.230.3730.04019.18
5.4.220.3370.03719.14
5.4.210.3900.03319.18
5.4.200.3630.03019.43
5.4.190.3670.04019.29
5.4.180.3900.03319.32
5.4.170.3530.03719.03
5.4.160.4170.04019.37
5.4.150.4570.03319.26
5.4.140.4530.03716.50
5.4.130.4570.04016.61
5.4.120.4570.03716.63
5.4.110.4530.03016.74
5.4.100.3900.04316.68
5.4.90.3500.03316.68
5.4.80.3130.03716.48
5.4.70.3100.03316.76
5.4.60.3570.04016.64
5.4.50.3100.03716.56
5.4.40.3570.03716.47
5.4.30.3600.03016.45
5.4.20.3670.03716.58
5.4.10.3800.03316.59
5.4.00.3570.03016.07
5.3.290.3470.04014.87
5.3.280.3770.04014.60
5.3.270.3830.03714.61
5.3.260.4370.03314.75
5.3.250.4670.03714.75
5.3.240.4400.04714.64
5.3.230.4600.03714.71
5.3.220.3270.03314.73
5.3.210.3370.04014.66
5.3.200.3200.03714.73
5.3.190.3930.04014.62
5.3.180.3670.03714.64
5.3.170.3530.02714.64
5.3.160.4770.03714.76
5.3.150.3100.03314.70
5.3.140.3400.03314.70
5.3.130.3730.03714.60
5.3.120.3700.03714.71
5.3.110.3930.04714.60
5.3.100.3800.04314.11
5.3.90.3530.03314.22
5.3.80.4100.04014.18
5.3.70.3830.03314.23
5.3.60.3630.03014.10
5.3.50.3870.03014.07
5.3.40.3670.03314.03
5.3.30.2970.03013.95
5.3.20.0100.06013.87
5.3.10.3330.03313.64
5.3.00.3530.03713.81
5.2.170.3000.03011.19
5.2.160.2970.02711.18
5.2.150.3270.02311.38
5.2.140.0030.06311.17
5.2.130.0100.05011.31
5.2.120.0800.04711.18
5.2.110.3000.02711.22
5.2.100.3270.02311.16
5.2.90.3300.02311.33
5.2.80.3200.02711.27
5.2.70.3200.02711.13
5.2.60.3200.02711.08
5.2.50.3230.02711.18
5.2.40.2330.02711.13
5.2.30.2330.02711.00
5.2.20.2570.02711.09
5.2.10.2400.03011.08
5.2.00.2670.02310.98
5.1.60.2400.02010.21
5.1.50.2570.02310.21
5.1.40.2730.03010.21
5.1.30.2370.02310.54
5.1.20.2630.02710.60
5.1.10.2570.02710.32
5.1.00.1130.02710.32
5.0.50.0000.0508.79
5.0.40.0030.0278.64
5.0.30.0070.0638.42
5.0.20.0000.0238.45
5.0.10.1400.0208.39
5.0.00.1800.0278.46
4.4.90.1500.0176.18
4.4.80.1430.0206.18
4.4.70.1170.0136.18
4.4.60.1170.0176.18
4.4.50.1430.0176.18
4.4.40.1470.0276.18
4.4.30.1230.0106.18
4.4.20.1330.0176.18
4.4.10.0070.0336.18
4.4.00.0070.0376.18
4.3.110.0030.0336.18
4.3.100.0000.0206.18
4.3.90.0070.0306.18
4.3.80.1700.0236.18
4.3.70.1770.0176.18
4.3.60.1730.0176.18
4.3.50.1430.0176.18
4.3.40.1570.0306.18
4.3.30.0600.0136.18
4.3.20.0730.0236.18
4.3.10.0630.0176.18
4.3.00.0700.0136.18

preferences:
36.42 ms | 401 KiB | 5 Q