3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_string = <<<EOX <?xml version="1.0" encoding="UTF-8"?> <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref"> <gesmes:subject>Reference rates</gesmes:subject> <gesmes:Sender> <gesmes:name>European Central Bank</gesmes:name> </gesmes:Sender> <Cube> <Cube time='2013-08-23'> <Cube currency='USD' rate='1.3355'/> <Cube currency='GBP' rate='0.85910'/> <Cube currency='HUF' rate='298.98'/> </Cube> </Cube> </gesmes:Envelope> EOX; $xml = simplexml_load_string($xml_string); $xml->registerXPathNamespace('c', 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'); $result = $xml->xpath('//c:Cube'); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> object(SimpleXMLElement)#2 (1) { ["Cube"]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["time"]=> string(10) "2013-08-23" } ["Cube"]=> array(3) { [0]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "USD" ["rate"]=> string(6) "1.3355" } } [1]=> object(SimpleXMLElement)#9 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "GBP" ["rate"]=> string(7) "0.85910" } } [2]=> object(SimpleXMLElement)#10 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "HUF" ["rate"]=> string(6) "298.98" } } } } } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["time"]=> string(10) "2013-08-23" } ["Cube"]=> array(3) { [0]=> object(SimpleXMLElement)#7 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "USD" ["rate"]=> string(6) "1.3355" } } [1]=> object(SimpleXMLElement)#10 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "GBP" ["rate"]=> string(7) "0.85910" } } [2]=> object(SimpleXMLElement)#9 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "HUF" ["rate"]=> string(6) "298.98" } } } } [2]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "USD" ["rate"]=> string(6) "1.3355" } } [3]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "GBP" ["rate"]=> string(7) "0.85910" } } [4]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) { ["currency"]=> string(3) "HUF" ["rate"]=> string(6) "298.98" } } }

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:
34.02 ms | 409 KiB | 8 Q