3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = new DOMDocument(); $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'; print_r($xpath->query($query)); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); } #print $root->saveXML();

preferences:
45.35 ms | 402 KiB | 5 Q