3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadXML('<tridas:object> <tridas:title>ppp</tridas:title> <tridas:type normalStd="Tellervo" normalId="1" normal="Site"/> <tridas:genericField name="tellervo.objectLabCode">2222</tridas:genericField> </tridas:object> '); $tellervoNS = "http://www.tellervo.org/schema/1.0"; $tridasNS = "http://www.tridas.org/1.2.2"; $xpath = new DOMXPath($doc); $xpath->registerNamespace('cor', $tellervoNS); $xpath->registerNamespace('tridas', $tridasNS); $fragment = $xpath->query("/cor:tellervo/cor:request/*"); foreach ($fragment as $item) { echo $item->nodeName, ' / ', $item->tagName; }
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/fN9ht on line 3 Warning: DOMDocument::loadXML(): Namespace prefix tridas on title is not defined in Entity, line: 1 in /in/fN9ht on line 3 Warning: DOMDocument::loadXML(): Namespace prefix tridas on type is not defined in Entity, line: 1 in /in/fN9ht on line 3 Warning: DOMDocument::loadXML(): Namespace prefix tridas on genericField is not defined in Entity, line: 1 in /in/fN9ht on line 3

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:
58.63 ms | 402 KiB | 8 Q