3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $domDoc = new DOMDocument; $domDoc->preserveWhiteSpace=false; $domDoc->loadXML(<<XML <?xml version="1.0"?> <CONFIG> <APP-ID>166533e56</APP-ID> </CONFIG> XML ); $rootNode = $domDoc->documentElement; $config_root = $rootNode->getElementsByTagName("CONFIG"); $rootElt = $domDoc->createElement('USER-ID'); $subNode = $rootNode->appendChild($rootElt); $textNode = $domDoc->createTextNode('333265332f'); $subNode->appendChild($textNode); $rootElt = $domDoc->createElement('USER-NAME'); $sub2Node = $rootNode->appendChild($rootElt); $textNode = $domDoc->createTextNode('John'); $sub2Node->appendChild($textNode); $domDoc->formatOutput = true; //$domDoc->save('config.xml'); echo $domDoc->saveXML();
Output for 5.5.0 - 5.5.3
Parse error: syntax error, unexpected '<<' (T_SL) in /in/rv4vI on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '<<' (T_SL), expecting ')' in /in/rv4vI on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_SL, expecting ')' in /in/rv4vI on line 4
Process exited with code 255.