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($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.0100.01317.38
8.3.50.0090.02517.20
8.3.40.0100.01619.64
8.3.30.0070.01319.58
8.3.20.0070.00421.22
8.3.10.0000.01122.52
8.3.00.0040.00721.61
8.2.180.0200.01019.36
8.2.170.0180.00322.96
8.2.160.0100.01022.88
8.2.150.0000.01224.18
8.2.140.0030.00824.66
8.2.130.0060.00623.13
8.2.120.0120.00026.35
8.2.110.0070.00721.32
8.2.100.0040.01418.78
8.2.90.0030.01019.96
8.2.80.0080.00519.04
8.2.70.0070.00718.38
8.2.60.0030.00918.91
8.2.50.0040.01118.80
8.2.40.0030.00923.05
8.2.30.0000.01321.86
8.2.20.0030.00919.05
8.2.10.0030.00919.02
8.2.00.0030.01019.18
8.1.280.0100.01025.92
8.1.270.0090.00324.75
8.1.260.0070.00426.35
8.1.250.0040.00728.09
8.1.240.0100.00321.80
8.1.230.0000.01720.13
8.1.220.0000.01418.79
8.1.210.0060.00918.77
8.1.200.0070.00718.35
8.1.190.0030.00918.10
8.1.180.0040.00818.66
8.1.170.0030.01019.51
8.1.160.0030.00919.97
8.1.150.0030.01021.53
8.1.140.0030.01020.53
8.1.130.0040.00819.73
8.1.120.0060.00618.46
8.1.110.0030.01018.35
8.1.100.0030.01018.21
8.1.90.0070.00718.38
8.1.80.0070.00718.33
8.1.70.0040.00818.24
8.1.60.0110.00318.47
8.1.50.0000.01318.48
8.1.40.0030.01018.50
8.1.30.0000.01218.68
8.1.20.0030.00918.56
8.1.10.0040.01118.47
8.1.00.0060.00618.54
8.0.300.0030.00919.06
8.0.290.0080.00417.50
8.0.280.0060.00619.39
8.0.270.0060.00618.24
8.0.260.0030.00917.80
8.0.250.0000.01117.99
8.0.240.0000.01417.67
8.0.230.0040.00817.93
8.0.220.0060.00617.71
8.0.210.0030.00917.91
8.0.200.0060.00617.87
8.0.190.0030.01317.94
8.0.180.0040.00817.94
8.0.170.0070.00717.80
8.0.160.0040.00817.95
8.0.150.0060.00617.61
8.0.140.0100.00317.89
8.0.130.0040.00714.33
8.0.120.0060.00717.86
8.0.110.0030.00917.67
8.0.100.0060.00617.79
8.0.90.0000.01317.80
8.0.80.0120.01817.81
8.0.70.0030.01217.90
8.0.60.0000.01217.82
8.0.50.0000.01217.84
8.0.30.0110.01617.92
8.0.20.0130.02017.99
8.0.10.0030.00917.82
8.0.00.0030.04117.75
7.4.330.0050.00516.02
7.4.320.0040.00717.48
7.4.300.0040.00817.51
7.4.290.0060.00617.38
7.4.280.0000.01317.57
7.4.270.0000.01317.55
7.4.260.0040.00714.18
7.4.250.0000.01217.57
7.4.240.0000.01217.58
7.4.230.0000.01217.67
7.4.220.0100.02417.57
7.4.210.0100.01717.53
7.4.200.0030.00917.64
7.4.160.0100.02317.41
7.4.150.0170.03017.40
7.4.140.0100.03117.86
7.4.130.0090.03417.51
7.4.120.0150.02517.37
7.4.110.0090.02517.61
7.4.100.0130.02717.34
7.4.90.0130.02017.27
7.4.80.0190.02619.39
7.4.70.0100.02117.43
7.4.60.0100.02217.43
7.4.50.0100.01317.13
7.4.40.0170.01317.41
7.4.30.0160.02817.34
7.4.00.0070.01715.79
7.3.330.0060.00614.09
7.3.320.0050.00514.23
7.3.310.0030.00917.40
7.3.300.0080.00417.32
7.3.290.0060.00617.15
7.3.280.0090.02217.28
7.3.270.0120.01917.40
7.3.260.0140.01917.40
7.3.250.0130.02817.36
7.3.240.0140.02517.48
7.3.230.0060.02717.29
7.3.210.0140.01717.20
7.3.200.0120.03117.41
7.3.190.0090.02217.14
7.3.180.0130.01917.43
7.3.170.0200.01017.35
7.3.160.0090.02217.52
7.2.330.0120.03617.71
7.2.320.0100.03017.24
7.2.310.0060.02517.77
7.2.300.0180.03117.70
7.2.290.0120.02117.81
7.2.80.0140.00317.20
7.2.60.0040.01517.61
7.1.200.0070.01616.37
7.1.70.0060.01618.00
7.1.60.0730.02034.17
7.1.50.0700.03334.05
7.1.40.0700.01733.42
7.1.30.1630.02033.61
7.1.20.0530.02733.67
7.1.10.0400.02315.50
7.1.00.0300.02315.55
7.0.200.0600.02315.88
7.0.190.0670.03015.81
7.0.180.0430.02015.22
7.0.170.0470.02715.13
7.0.160.0470.02315.19
7.0.150.0500.02315.32
7.0.140.0300.02315.29
7.0.130.0270.02715.60
7.0.120.0300.02015.49
7.0.110.0270.02015.43
7.0.100.0230.03015.27
7.0.90.0230.02715.30
7.0.80.0230.02315.47
7.0.70.0200.02715.36
7.0.60.0230.02315.22
7.0.50.0200.03015.26
7.0.40.0230.02015.40
7.0.30.0200.02315.29
7.0.20.0230.02315.37
7.0.10.0270.02015.35
7.0.00.0230.02015.36

preferences:
39.39 ms | 400 KiB | 5 Q