3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $root = new DOMDocument(); $root->loadXML('<article id=""><h1></h1><p></p></article>'); $node = new DOMDocument(); $node->loadXML('<bar>baz</bar>'); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); print $root->saveXML();
based on 2aNd5
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
<?xml version="1.0"?> <article id=""><h1/><p/><bar>baz</bar></article>