3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <html> <body> <div class="regular-box">DIV 0</div> <div class="comments-box">DIV 1</div> <div class="heycomments-box">DIV 2</div> <div class="sdfcomments-box">DIV 3</div> <div class="sdgsdgcomments-boxsdfdfh">DIV 4</div> </body> </html> HTML; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); $xp = new DOMXPath($dom); // get the node list of div nodes with "target" class $spanNodeList = $xp->query('//div[contains(@class, "comments-box")]'); foreach ($spanNodeList as $spanNode) { $spanNode->parentNode->replaceChild($spanNode->firstChild, $spanNode); } echo $dom->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.0150.00317.00
8.3.50.0090.00618.38
8.3.40.0110.00418.99
8.3.30.0060.00919.14
8.3.20.0000.00824.03
8.3.10.0080.00022.02
8.3.00.0040.00422.89
8.2.180.0040.01118.76
8.2.170.0110.00422.96
8.2.160.0140.00022.48
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0000.00920.96
8.2.110.0060.00621.44
8.2.100.0130.00318.28
8.2.90.0080.00018.15
8.2.80.0000.00819.34
8.2.70.0000.00818.18
8.2.60.0000.00818.41
8.2.50.0000.00818.10
8.2.40.0000.00921.47
8.2.30.0080.00019.63
8.2.20.0040.00418.49
8.2.10.0070.00019.35
8.2.00.0000.00819.73
8.1.270.0050.00224.66
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0070.01422.84
8.1.230.0040.00821.27
8.1.220.0040.00418.01
8.1.210.0040.00418.96
8.1.200.0050.01017.63
8.1.190.0040.00417.25
8.1.180.0060.00318.10
8.1.170.0080.00020.98
8.1.160.0070.00019.33
8.1.150.0040.00419.26
8.1.140.0050.00319.24
8.1.130.0030.00320.37
8.1.120.0050.00217.79
8.1.110.0080.00017.73
8.1.100.0060.00317.73
8.1.90.0000.00917.74
8.1.80.0000.00717.75
8.1.70.0040.00417.84
8.1.60.0000.00917.82
8.1.50.0080.00017.85
8.1.40.0000.00817.90
8.1.30.0060.00317.93
8.1.20.0040.00417.98
8.1.10.0040.00417.82
8.1.00.0060.00317.75
8.0.300.0070.00020.23
8.0.290.0050.00217.00
8.0.280.0050.00218.79
8.0.270.0000.00717.11
8.0.260.0000.00620.25
8.0.250.0040.00417.31
8.0.240.0000.00717.38
8.0.230.0000.00717.41
8.0.220.0000.00717.34
8.0.210.0040.00417.20
8.0.200.0060.00317.31
8.0.190.0030.00317.38
8.0.180.0030.00517.32
8.0.170.0060.00317.16
8.0.160.0040.00417.23
8.0.150.0020.00517.34
8.0.140.0000.00717.23
8.0.130.0060.00013.83
8.0.120.0050.00217.30
8.0.110.0000.00817.23
8.0.100.0040.00417.19
8.0.90.0050.00517.15
8.0.80.0070.00717.16
8.0.70.0000.00817.30
8.0.60.0000.00817.18
8.0.50.0080.00017.34
8.0.30.0220.00917.50
8.0.20.0090.00917.34
8.0.10.0060.00317.26
8.0.00.0190.00317.24
7.4.330.0000.00615.55
7.4.320.0000.00616.84
7.4.300.0000.00716.90
7.4.290.0030.00316.81
7.4.280.0040.00416.82
7.4.270.0030.00316.89
7.4.260.0000.00513.56
7.4.250.0000.00816.78
7.4.240.0020.00616.90
7.4.230.0050.00316.94
7.4.220.0030.00316.83
7.4.210.0100.00916.95
7.4.200.0050.00216.74
7.4.130.0120.00616.76
7.4.120.0140.00317.04
7.4.110.0080.01216.93
7.4.100.0150.00617.00
7.4.90.0100.00716.71
7.4.80.0110.00819.39
7.4.70.0140.00316.77
7.4.60.0030.01316.85
7.4.50.0090.00616.72
7.4.40.0170.00316.78
7.4.00.0050.01215.23
7.3.330.0000.00716.79
7.3.320.0000.00513.43
7.3.310.0000.00716.79
7.3.300.0020.00516.74
7.3.290.0040.00416.59
7.3.260.0100.00916.86
7.3.240.0060.01116.76
7.3.230.0100.00716.69
7.3.210.0050.01416.62
7.3.200.0090.01116.73
7.3.190.0190.00316.75
7.3.180.0130.00717.03
7.3.170.0060.01516.74
7.3.160.0100.00716.91
7.3.120.0070.01115.22
7.3.110.0040.01215.08
7.3.100.0110.00614.88
7.3.90.0060.00914.99
7.3.80.0060.00715.01
7.3.70.0070.00714.78
7.3.60.0100.00415.08
7.3.50.0050.00814.99
7.3.40.0080.00514.90
7.3.30.0050.00814.99
7.3.20.0070.00715.71
7.3.10.0040.01115.88
7.3.00.0090.00515.85
7.2.330.0150.00417.04
7.2.320.0110.01116.94
7.2.310.0030.01316.98
7.2.300.0110.00617.01
7.2.290.0130.00316.98
7.2.250.0130.00615.03
7.2.240.0110.00615.22
7.2.230.0070.01015.33
7.2.220.0050.00915.25
7.2.210.0070.00715.14
7.2.200.0080.00815.25
7.2.190.0100.00715.13
7.2.180.0050.00915.15
7.2.170.0070.00815.18
7.2.160.0160.00615.18
7.2.150.0040.01115.09
7.2.140.0080.00815.10
7.2.130.0080.00815.38
7.2.120.0120.00915.29
7.2.110.0100.01015.52
7.2.100.0130.00715.07
7.2.90.0060.00915.26
7.2.80.0090.00615.55
7.2.70.0090.00615.25
7.2.60.0030.01115.16
7.2.50.0060.00915.09
7.2.40.0070.00715.29
7.2.30.0070.00715.53
7.2.20.0110.00415.30
7.2.10.0060.00915.39
7.2.00.0000.01514.96
7.1.330.0070.00615.14
7.1.320.0090.00315.15
7.1.310.0050.00615.07
7.1.300.0100.00314.91
7.1.290.0090.00414.97
7.1.280.0050.00615.18
7.1.270.0100.00414.92
7.1.260.0060.00815.09
7.1.250.0080.00514.14

preferences:
64.89 ms | 400 KiB | 5 Q