3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testclass{ public $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 = $this->xmlRequestDom->documentElement->childNodes; foreach($children as $child) { if($child->nodeType != XML_ELEMENT_NODE) continue; echo $child->nodeName; } } } $newxml = "<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>"; $myParamObj = new testclass($newxml);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadXML(): Namespace prefix tridas on object is not defined in Entity, line: 1 in /in/iXKkb on line 15 Warning: DOMDocument::loadXML(): Namespace prefix tridas on title is not defined in Entity, line: 2 in /in/iXKkb on line 15 Warning: DOMDocument::loadXML(): Namespace prefix tridas on type is not defined in Entity, line: 3 in /in/iXKkb on line 15 Warning: DOMDocument::loadXML(): Namespace prefix tridas on genericField is not defined in Entity, line: 4 in /in/iXKkb on line 15 tridas:titletridas:typetridas:genericField

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.22 ms | 402 KiB | 8 Q