3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php $html = <<<HTML <div> <div> <p> ... </p> </div> </div> HTML; $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $nodes = $xpath->query('//*'); foreach ($nodes as $node) { printf( "Nodes in List: %d \n" . "Current Tag: %s \n" . "Current Parent: %s \n\n", $nodes->length, $node->tagName, $node->parentNode->tagName ); $node->parentNode->removeChild($node); } 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)
5.4.160.0130.04018.82
5.4.150.0330.03319.17
5.4.140.0130.03716.32
5.4.130.0170.03316.36
5.4.120.0130.03716.33
5.4.110.0130.04016.38
5.4.100.0270.04316.61
5.4.90.0170.03316.56
5.4.80.0100.05716.51
5.4.70.0130.03716.57
5.4.60.0200.05716.38
5.4.50.0100.04716.33
5.4.40.0230.02716.53
5.4.30.0200.03016.16
5.4.20.0200.03016.16
5.4.10.0100.04016.48
5.4.00.0200.02715.75
5.3.260.0170.03714.65
5.3.250.0170.03714.44
5.3.240.0230.04014.55
5.3.230.0130.04314.55
5.3.220.0200.04314.51
5.3.210.0200.04714.50
5.3.200.0170.07314.47
5.3.190.0200.07714.39
5.3.180.0200.03314.59
5.3.170.0270.05014.51
5.3.160.0170.04714.51
5.3.150.0200.03014.42
5.3.140.0200.04314.46
5.3.130.0330.04714.38
5.3.120.0130.04014.50
5.3.110.0100.04314.59
5.3.100.0230.04314.06
5.3.90.0030.05013.99
5.3.80.0170.04013.95
5.3.70.0130.04013.85
5.3.60.0200.03313.80
5.3.50.0230.03713.78
5.3.40.0130.04013.79
5.3.30.0230.03013.68
5.3.20.0270.03313.63
5.3.10.0200.04013.43
5.3.00.0270.03713.43

preferences:
132.77 ms | 1398 KiB | 7 Q