3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $root = new DOMDocument(); $root->loadXML('<article id=""></article>'); for($i=0;$i<=3;$i++){ $node = new DOMDocument(); $node->loadXML('<section><h1>Überschrift1</h1><h2>Überschrift2</h2><p>Content</p></section>'); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); } print $root->saveXML();
based on TR5fb
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
<?xml version="1.0"?> <article id=""><section><h1>&#xDC;berschrift1</h1><h2>&#xDC;berschrift2</h2><p>Content</p></section><section><h1>&#xDC;berschrift1</h1><h2>&#xDC;berschrift2</h2><p>Content</p></section><section><h1>&#xDC;berschrift1</h1><h2>&#xDC;berschrift2</h2><p>Content</p></section><section><h1>&#xDC;berschrift1</h1><h2>&#xDC;berschrift2</h2><p>Content</p></section></article>