3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testclass{ var $xmlRequestDom = NULL; function __construct($xmlrequest) { if (gettype($xmlrequest)=='object') { $this->xmlRequestDom = $xmlrequest; } else { $this->xmlRequestDom = new DomDocument(); $this->xmlRequestDom->loadXML($xmlrequest); } $this->setParamsFromXMLRequest(); } function setParamsFromXMLRequest() { $children = $doc->documentElement->childNodes; foreach($children as $child) { if($child->nodeType != XML_ELEMENT_NODE) continue; echo $child->nodeName; } } } $newxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <c:tellervo xmlns:c=\"http://www.tellervo.org/schema/1.0\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:tridas=\"http://www.tridas.org/1.2.2\"> <c:request type=\"create\"> <tridas:object> <tridas:title>ppp</tridas:title> <tridas:type normalStd=\"Tellervo\" normalId=\"1\" normal=\"Site\" /> <tridas:genericField name=\"tellervo.objectLabCode\">ppp</tridas:genericField> </tridas:object> </c:request> </c:tellervo>"; $myParamObj = new testclass($newxml)
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected end of file in /in/mfAlc on line 49
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected $end in /in/mfAlc on line 49
Process exited with code 255.

preferences:
181.2 ms | 1386 KiB | 47 Q