3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xmlrequest = new DOMDocument; $xmlrequest->preserveWhiteSpace = false; $xmlrequest->loadXML(<<<XML <?xml version="1.0"?> <request> <APP-ID>166533e56</APP-ID> </request> XML ); $rootNode = $xmlrequest->documentElement; $request_root = $rootNode->getElementsByTagName("request"); foreach($xmldata as $k => $v){ $rootElt = $xmlrequest->createElement('email'); $subNode = $rootNode->appendChild($rootElt); $subrootElt = $xmlrequest->createElement('recipient'); $subsubNode = $subNode->appendChild($subrootElt); $textNode = $xmlrequest->createTextNode(md5(strtolower($v->contacts_emailaddress))); $subsubNode->appendChild($textNode); $subrootElt = $xmlrequest->createElement('list'); $subsub2Node = $subNode->appendChild($subrootElt); $textNode = $xmlrequest->createTextNode($this->list_id); $subsub2Node->appendChild($textNode); $subrootElt = $xmlrequest->createElement('domain'); $subsub3Node = $subNode->appendChild($subrootElt); $textNode = $xmlrequest->createTextNode($v->contacts_domainname); $subsub3Node->appendChild($textNode); } $xmlrequest->formatOutput = true; //$domDoc->save('config.xml'); echo $xmlrequest->saveXML(); /*$xmlrequest .= "</request>".'<br/>';*/ return $xmlrequest; }
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected end of file in /in/bJT2p on line 38
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected $end in /in/bJT2p on line 38
Process exited with code 255.