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); if($entries->length===1){ $entries->item(0)->nodeValue = ""; $entries->item(0)->appendChild($node->createTextNode($entries->length."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.0130.01017.63
8.3.50.0110.01117.50
8.3.40.0190.01219.54
8.3.30.0070.01419.59
8.3.20.0080.00321.16
8.3.10.0050.00524.45
8.3.00.0000.01121.68
8.2.180.0100.02019.29
8.2.170.0120.00922.96
8.2.160.0130.01322.96
8.2.150.0080.00324.18
8.2.140.0090.00324.66
8.2.130.0100.00021.47
8.2.120.0040.00826.35
8.2.110.0080.00521.38
8.2.100.0030.01318.72
8.2.90.0030.01020.09
8.2.80.0030.00919.16
8.2.70.0080.00618.50
8.2.60.0030.00919.04
8.2.50.0090.00619.04
8.2.40.0000.01223.23
8.2.30.0030.00921.87
8.2.20.0000.01219.00
8.2.10.0040.00819.07
8.2.00.0060.00619.17
8.1.280.0070.01425.92
8.1.270.0060.00624.84
8.1.260.0030.00826.35
8.1.250.0000.01128.09
8.1.240.0120.00021.84
8.1.230.0130.00320.03
8.1.220.0000.01418.64
8.1.210.0040.01418.77
8.1.200.0000.01518.36
8.1.190.0060.00618.23
8.1.180.0100.00318.40
8.1.170.0060.00619.64
8.1.160.0000.01219.95
8.1.150.0030.00921.54
8.1.140.0000.01220.60
8.1.130.0080.00419.82
8.1.120.0060.00618.29
8.1.110.0030.00918.35
8.1.100.0030.01018.38
8.1.90.0090.00318.33
8.1.80.0030.01018.45
8.1.70.0000.01218.50
8.1.60.0030.01018.58
8.1.50.0030.01018.46
8.1.40.0000.01418.53
8.1.30.0060.00618.61
8.1.20.0040.01018.67
8.1.10.0030.01018.43
8.1.00.0000.01418.30
8.0.300.0040.01119.10
8.0.290.0030.00917.75
8.0.280.0060.00619.33
8.0.270.0060.00618.18
8.0.260.0000.01117.86
8.0.250.0000.01118.00
8.0.240.0030.01017.66
8.0.230.0000.01317.87
8.0.220.0000.01217.96
8.0.210.0060.00617.70
8.0.200.0040.00817.73
8.0.190.0070.01017.77
8.0.180.0000.01217.95
8.0.170.0030.01017.94
8.0.160.0000.01217.92
8.0.150.0000.01317.88
8.0.140.0030.01017.78
8.0.130.0030.00814.20
8.0.120.0060.00617.95
8.0.110.0060.00617.91
8.0.100.0000.01317.76
8.0.90.0000.01217.86
8.0.80.0110.02417.78
8.0.70.0000.01617.82
8.0.60.0040.00817.77
8.0.50.0040.00817.89
8.0.30.0100.01718.05
8.0.20.0120.02118.09
8.0.10.0060.00617.79
8.0.00.0160.02917.72
7.4.330.0030.00615.97
7.4.320.0000.01117.51
7.4.300.0030.00917.46
7.4.290.0000.01317.56
7.4.280.0060.00917.64
7.4.270.0060.00617.53
7.4.260.0030.00914.09
7.4.250.0000.01217.33
7.4.240.0000.01217.52
7.4.230.0030.00917.60
7.4.220.0130.02317.41
7.4.210.0030.03117.56
7.4.200.0060.00617.64
7.4.160.0070.02317.29
7.4.150.0210.01817.48
7.4.140.0110.02917.86
7.4.130.0170.02817.46
7.4.120.0110.02317.41
7.4.110.0140.02017.43
7.4.100.0140.02117.54
7.4.90.0100.02117.30
7.4.80.0070.02519.39
7.4.70.0130.01917.55
7.4.60.0070.02817.42
7.4.50.0060.01517.59
7.4.40.0030.02917.54
7.4.30.0100.03417.42
7.4.00.0100.01415.79
7.3.330.0030.00714.08
7.3.320.0030.00714.09
7.3.310.0030.00917.04
7.3.300.0090.00317.19
7.3.290.0030.01017.31
7.3.280.0080.02417.23
7.3.270.0070.02517.40
7.3.260.0130.02217.29
7.3.250.0140.02417.43
7.3.240.0140.02417.40
7.3.230.0160.01617.52
7.3.210.0140.01717.37
7.3.200.0100.02217.52
7.3.190.0070.02417.41
7.3.180.0110.01917.56
7.3.170.0070.02317.46
7.3.160.0070.02317.17
7.2.330.0100.02617.68
7.2.320.0070.02617.71
7.2.310.0120.01917.44
7.2.300.0150.01917.53
7.2.290.0180.01517.41
7.2.00.0070.01120.39
7.1.100.0040.01818.96
7.1.70.0060.01917.71
7.1.60.0470.02034.19
7.1.50.0430.03034.05
7.1.40.0430.02033.49
7.1.30.0430.02033.52
7.1.20.0500.04033.55
7.1.10.0270.02015.45
7.1.00.0230.02015.43
7.0.200.0370.01715.89
7.0.190.0700.02715.59
7.0.180.0370.01315.23
7.0.170.0230.02715.32
7.0.160.0300.02015.31
7.0.150.0170.03015.23
7.0.140.0270.02015.31
7.0.130.0270.01715.32
7.0.120.0270.02715.54
7.0.110.0200.02715.25
7.0.100.0230.02315.22
7.0.90.0330.02715.31
7.0.80.0270.02015.20
7.0.70.0230.02015.16
7.0.60.0230.02315.07
7.0.50.0230.03715.32
7.0.40.0200.02715.32
7.0.30.0300.02015.37
7.0.20.0270.02015.36
7.0.10.0270.02015.44
7.0.00.0300.02715.31

preferences:
48.5 ms | 400 KiB | 5 Q