3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new DOMDocument(); if ($xml->load("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml")){ $root = $xml->documentElement; $date = $items->item(1)->getAttribute('time'); $items = $root->getElementsByTagName('Cube'); foreach ($items as $item){ echo $item->getAttribute('currency'); } }
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/JbXQI on line 3 Warning: DOMDocument::load(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/JbXQI on line 3 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/JbXQI on line 3
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml (Could not resolve host: www.ecb.europa.eu)
Output for 5.1.0 - 5.2.5
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/JbXQI on line 3 Warning: DOMDocument::load(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): failed to open stream: Connection refused in /in/JbXQI on line 3 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/JbXQI on line 3
Output for 5.0.3 - 5.0.5
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/JbXQI on line 3 Warning: DOMDocument::load(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): failed to open stream: Connection refused in /in/JbXQI on line 3 Warning: connection refusedI/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/JbXQI on line 3
Output for 5.0.1 - 5.0.2
Warning: DOMDocument::load(): php_network_getaddresses: gethostbyname failed in /in/JbXQI on line 3 Warning: DOMDocument::load(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): failed to open stream: Success in /in/JbXQI on line 3 Warning: connection refusedI/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/JbXQI on line 3
Output for 5.0.0
Warning: DOMDocument::load(): php_network_getaddresses: gethostbyname failed in /in/JbXQI on line 3 Warning: DOMDocument::load(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): failed to open stream: Bad file descriptor in /in/JbXQI on line 3 Warning: connection refusedI/O warning : failed to load external entity "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" in /in/JbXQI on line 3
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/JbXQI on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/JbXQI on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/JbXQI on line 5
Process exited with code 255.