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_file('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); $xml->registerXPathNamespace('c', 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'); $result = $xml->xpath('//c:Cube[@currency="USD"]'); echo count($result);
Output for git.master, git.master_jit
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/O8YHa on line 20 Warning: simplexml_load_file(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): Failed to open stream: php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/O8YHa on line 20 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/O8YHa on line 20 Fatal error: Uncaught Error: Call to a member function registerXPathNamespace() on bool in /in/O8YHa:22 Stack trace: #0 {main} thrown in /in/O8YHa on line 22
Process exited with code 255.
Output for rfc.property-hooks
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/O8YHa on line 20 Warning: simplexml_load_file(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): Failed to open stream: php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/O8YHa on line 20 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/O8YHa on line 20 Fatal error: Uncaught Error: Call to a member function registerXPathNamespace() on false in /in/O8YHa:22 Stack trace: #0 {main} thrown in /in/O8YHa on line 22
Process exited with code 255.

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