3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = new DOMDocument(); $root->formatOutput = true; $root->loadXML('<article id=""></article>'); for($i=0;$i<=300;$i++){ $node = new DOMDocument(); $node->loadXML('<section id="'.$i.'"><h1>Überschrift</h1><h2>Überschrift2</h2><p>Content</p></section>'); $xpath = new DOMXPath($node); $query = '//h1'; $entries=$xpath->query($query); $entries->item(0)->nodeValue = ""; $entries->item(0)->appendChild($node->createTextNode("Text ".$i)); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); } print $root->saveXML();

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.0150.00917.38
8.3.50.0060.01517.50
8.3.40.0190.00619.80
8.3.30.0070.01319.50
8.3.20.0050.00521.04
8.3.10.0040.00722.73
8.3.00.0040.00721.69
8.2.180.0070.02319.53
8.2.170.0150.00622.96
8.2.160.0000.02123.13
8.2.150.0080.00324.18
8.2.140.0080.00424.66
8.2.130.0000.01123.13
8.2.120.0040.00826.35
8.2.110.0060.00923.38
8.2.100.0100.00718.84
8.2.90.0040.00819.99
8.2.80.0080.00618.93
8.2.70.0030.01018.38
8.2.60.0000.01218.80
8.2.50.0100.00319.04
8.2.40.0030.00923.15
8.2.30.0030.01020.29
8.2.20.0030.01019.00
8.2.10.0060.00619.07
8.2.00.0000.01219.11
8.1.280.0120.00925.92
8.1.270.0100.01024.70
8.1.260.0040.00726.35
8.1.250.0040.00728.09
8.1.240.0070.00724.71
8.1.230.0140.00322.95
8.1.220.0030.01018.64
8.1.210.0070.00718.77
8.1.200.0120.00318.35
8.1.190.0070.00718.35
8.1.180.0000.01318.53
8.1.170.0030.00919.66
8.1.160.0060.00619.94
8.1.150.0030.01021.48
8.1.140.0000.01220.64
8.1.130.0030.00919.91
8.1.120.0000.01218.52
8.1.110.0030.01018.41
8.1.100.0000.01318.36
8.1.90.0070.00718.34
8.1.80.0070.00718.22
8.1.70.0030.00818.47
8.1.60.0100.00318.59
8.1.50.0030.01018.31
8.1.40.0070.00718.51
8.1.30.0060.00618.69
8.1.20.0090.00318.69
8.1.10.0030.01018.58
8.1.00.0080.00418.55
8.0.300.0060.00619.02
8.0.290.0090.00317.75
8.0.280.0000.01219.33
8.0.270.0040.00818.26
8.0.260.0000.01119.45
8.0.250.0030.00917.95
8.0.240.0000.01317.67
8.0.230.0000.01317.76
8.0.220.0000.01217.87
8.0.210.0030.00917.76
8.0.200.0000.01217.86
8.0.190.0030.01517.86
8.0.180.0000.01217.95
8.0.170.0000.01217.77
8.0.160.0000.01317.91
8.0.150.0030.01017.85
8.0.140.0090.00317.74
8.0.130.0080.00414.31
8.0.120.0040.00817.88
8.0.110.0060.00617.72
8.0.100.0000.01317.91
8.0.90.0000.01217.79
8.0.80.0040.02517.71
8.0.70.0060.00617.82
8.0.60.0060.00617.76
8.0.50.0060.00617.77
8.0.30.0090.02218.10
8.0.20.0120.02117.97
8.0.10.0030.00917.78
8.0.00.0170.01717.85
7.4.330.0040.00715.89
7.4.320.0000.01117.46
7.4.300.0030.00817.54
7.4.290.0030.01017.37
7.4.280.0030.01017.59
7.4.270.0000.01317.43
7.4.260.0040.00714.28
7.4.250.0090.00617.45
7.4.240.0000.01217.50
7.4.230.0040.00817.57
7.4.220.0130.02217.58
7.4.210.0080.02717.48
7.4.200.0060.00617.38
7.4.160.0080.02117.47
7.4.150.0110.02217.40
7.4.140.0140.02317.86
7.4.130.0230.02317.39
7.4.120.0120.02017.48
7.4.110.0030.03017.61
7.4.100.0130.02017.40
7.4.90.0160.01917.35
7.4.80.0070.03719.39
7.4.70.0100.02017.42
7.4.60.0150.01917.31
7.4.50.0040.02217.50
7.4.40.0130.03217.28
7.4.30.0100.02317.40
7.4.00.0040.01815.75
7.3.330.0070.00314.18
7.3.320.0030.00714.20
7.3.310.0030.00917.23
7.3.300.0080.00417.31
7.3.290.0040.00817.27
7.3.280.0090.02017.27
7.3.270.0150.01817.40
7.3.260.0110.03117.59
7.3.250.0180.02417.31
7.3.240.0070.03117.43
7.3.230.0170.06117.58
7.3.210.0070.02717.39
7.3.200.0100.02217.71
7.3.190.0110.02217.42
7.3.180.0110.02217.54
7.3.170.0100.02017.52
7.3.160.0170.01617.35
7.2.330.0190.01617.65
7.2.320.0100.03017.74
7.2.310.0130.01917.71
7.2.300.0060.02917.46
7.2.290.0070.03417.48
7.2.60.0070.01717.60
7.2.00.0060.01320.29
7.1.200.0030.01316.48
7.1.100.0070.01418.54
7.1.70.0040.01117.88
7.1.60.0500.02734.01
7.1.50.0500.02033.89
7.1.40.0430.02733.57
7.1.30.0430.03033.54
7.1.20.0470.02333.55
7.1.10.0400.02015.52
7.1.00.0330.02315.44
7.0.200.0370.02715.51
7.0.190.0370.02315.85
7.0.180.0370.02015.19
7.0.170.0330.02015.32
7.0.160.0300.02315.29
7.0.150.0330.02015.32
7.0.140.0400.02015.29
7.0.130.0470.03015.48
7.0.120.0370.02315.48
7.0.110.0370.02315.25
7.0.100.0400.01715.32
7.0.90.0330.02315.27
7.0.80.0370.02015.32
7.0.70.0670.02315.35
7.0.60.0530.01715.10
7.0.50.0370.02315.40
7.0.40.0400.02015.51
7.0.30.0870.02715.52
7.0.20.0570.02715.42
7.0.10.0370.02315.46
7.0.00.0300.02715.36

preferences:
35.36 ms | 401 KiB | 5 Q