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.01117.75
8.3.50.0100.01017.46
8.3.40.0170.01019.71
8.3.30.0120.00919.54
8.3.20.0040.00721.18
8.3.10.0070.00422.72
8.3.00.0080.00321.83
8.2.180.0090.01619.25
8.2.170.0100.01022.96
8.2.160.0040.01923.08
8.2.150.0040.00724.18
8.2.140.0080.00324.66
8.2.130.0100.00323.01
8.2.120.0000.01126.35
8.2.110.0030.01021.41
8.2.100.0070.01018.66
8.2.90.0000.01320.09
8.2.80.0060.00618.90
8.2.70.0040.00918.37
8.2.60.0060.00618.91
8.2.50.0030.01018.80
8.2.40.0000.01323.06
8.2.30.0040.00820.17
8.2.20.0000.01219.01
8.2.10.0000.01319.03
8.2.00.0070.00719.11
8.1.280.0100.01025.92
8.1.270.0120.00822.94
8.1.260.0040.00726.35
8.1.250.0040.00728.09
8.1.240.0030.01021.91
8.1.230.0000.01720.09
8.1.220.0070.00718.78
8.1.210.0000.01318.77
8.1.200.0030.01018.36
8.1.190.0030.01018.35
8.1.180.0000.01218.51
8.1.170.0000.01419.56
8.1.160.0030.00919.97
8.1.150.0070.00721.58
8.1.140.0060.00620.44
8.1.130.0000.01219.80
8.1.120.0040.00818.50
8.1.110.0060.00618.20
8.1.100.0000.01318.48
8.1.90.0040.00818.45
8.1.80.0030.01018.49
8.1.70.0040.00818.50
8.1.60.0080.00418.61
8.1.50.0060.00618.50
8.1.40.0040.01118.48
8.1.30.0030.00918.61
8.1.20.0000.01318.51
8.1.10.0110.00418.45
8.1.00.0040.01118.42
8.0.300.0030.00919.06
8.0.290.0000.01217.50
8.0.280.0040.00819.45
8.0.270.0040.00818.20
8.0.260.0060.00617.72
8.0.250.0060.00617.86
8.0.240.0000.01417.93
8.0.230.0030.00917.86
8.0.220.0030.00917.77
8.0.210.0090.00317.89
8.0.200.0060.00617.85
8.0.190.0100.00717.77
8.0.180.0070.00717.93
8.0.170.0040.00817.75
8.0.160.0030.00917.88
8.0.150.0090.00317.86
8.0.140.0030.00917.75
8.0.130.0070.00314.35
8.0.120.0080.00417.80
8.0.110.0000.01217.70
8.0.100.0070.00717.80
8.0.90.0000.01217.71
8.0.80.0120.03017.79
8.0.70.0030.01017.64
8.0.60.0080.00417.71
8.0.50.0040.00817.66
8.0.30.0100.01717.81
8.0.20.0100.02417.96
8.0.10.0100.00317.87
8.0.00.0070.02717.39
7.4.330.0060.00315.94
7.4.320.0060.00617.53
7.4.300.0000.01117.60
7.4.290.0040.00817.50
7.4.280.0070.00717.58
7.4.270.0000.01417.38
7.4.260.0040.00714.25
7.4.250.0040.00817.34
7.4.240.0000.01217.46
7.4.230.0060.00617.36
7.4.220.0070.02717.52
7.4.210.0070.02517.52
7.4.200.0040.00917.64
7.4.160.0100.02217.36
7.4.150.0100.02317.40
7.4.140.0070.03417.86
7.4.130.0160.03017.34
7.4.120.0140.02217.37
7.4.110.0100.02317.43
7.4.100.0120.02117.31
7.4.90.0100.03717.38
7.4.80.0150.02119.39
7.4.70.0100.02117.46
7.4.60.0130.01917.41
7.4.50.0110.01517.36
7.4.40.0100.02617.32
7.4.30.0100.03317.52
7.4.00.0100.01315.52
7.3.330.0000.01014.19
7.3.320.0000.01114.14
7.3.310.0040.00817.21
7.3.300.0000.01117.36
7.3.290.0090.00317.20
7.3.280.0130.01917.27
7.3.270.0060.03017.40
7.3.260.0110.02217.44
7.3.250.0140.03217.21
7.3.240.0120.02017.48
7.3.230.0120.02117.27
7.3.210.0090.02217.44
7.3.200.0100.02417.16
7.3.190.0090.02217.26
7.3.180.0160.02317.50
7.3.170.0030.02617.26
7.3.160.0070.03817.48
7.2.330.0030.02817.64
7.2.320.0150.02217.58
7.2.310.0090.02217.76
7.2.300.0160.01617.21
7.2.290.0070.02517.77
7.2.60.0060.01517.40
7.1.200.0130.01016.40
7.1.70.0030.02517.92
7.1.60.0630.02734.14
7.1.50.0500.02733.72
7.1.40.0570.02733.46
7.1.30.0430.03033.60
7.1.20.0730.03033.57
7.1.10.0570.03015.42
7.1.00.0130.02015.68
7.0.200.0430.01715.74
7.0.190.0430.01715.75
7.0.180.0470.01315.39
7.0.170.0400.02015.24
7.0.160.0330.02715.20
7.0.150.0570.02315.18
7.0.140.0370.02015.34
7.0.130.0270.03015.39
7.0.120.0370.02315.43
7.0.110.0400.02015.30
7.0.100.0630.02715.15
7.0.90.0400.01715.38
7.0.80.0330.02015.33
7.0.70.0300.02315.29
7.0.60.0530.02015.20
7.0.50.0300.02315.26
7.0.40.0370.01715.56
7.0.30.0400.03315.51
7.0.20.0230.02715.39
7.0.10.0100.02715.40
7.0.00.0130.01315.39

preferences:
40.84 ms | 400 KiB | 5 Q