3v4l.org

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