3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=<<<XML <lookups> <lookup category="General" field="Country Code" value="FI" entityId="1" active="true" /> <lookup category="General" field="Country Name" value="Finland" entityId="2" active="true" /> <lookup category="General" field="Country Code" value="FI2" entityId="1" active="true" /> <lookup category="General" field="Country Name" value="Finland2" entityId="3" active="true" /> <lookup category="General" field="Country Code" value="FI3" entityId="1" active="true" /> <lookup category="General" field="Country Name" value="Finland3" entityId="4" active="true" /> <lookup category="General" field="Country Code" value="FI4" entityId="1" active="true" /> <lookup category="General" field="Country Name" value="Finland4" entityId="5" active="true" /> </lookups> XML; $xml=simplexml_load_string($str); $result=$xml->xpath('//lookup[@Country Code][@Country Name]'); foreach($result as $node) { echo $node; }
Output for git.master, git.master_jit
Warning: SimpleXMLElement::xpath(): Invalid predicate in /in/0gJnv on line 15 Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in /in/0gJnv on line 15 Warning: foreach() argument must be of type array|object, bool given in /in/0gJnv on line 16
Output for rfc.property-hooks
Warning: SimpleXMLElement::xpath(): Invalid predicate in /in/0gJnv on line 15 Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in /in/0gJnv on line 15 Warning: foreach() argument must be of type array|object, false given in /in/0gJnv on line 16

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:
54.98 ms | 401 KiB | 8 Q