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 id="'.$i'"><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 vI2mM
Output for 7.0.0 - 7.1.6
Parse error: syntax error, unexpected ''"><h1>Überschrift1</h1><h2>�' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in /in/qug4f on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/qug4f:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ''"><h1>Überschrift1</h1><h2>�' (T_CONSTANT_ENCAPSED_STRING) in /in/qug4f on line 7
Process exited with code 255.