3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // set feed URL $url = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys'; // read feed into SimpleXML object $sxml = simplexml_load_file($url); // then you can do var_dump($sxml); print_r($sxml); // And now you'll be able to call `$sxml->marketstat->type->buy->volume` as well as other properties. echo $sxml->diagnostics->results->Rate; ?>
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/CGouK on line 6 Warning: simplexml_load_file(http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/CGouK on line 6 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" in /in/CGouK on line 6 bool(false) Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys (Could not resolve host: query.yahooapis.com) in /in/CGouK on line 6 bool(false) Notice: Cannot access property on non-object in /in/CGouK on line 12 Notice: Cannot access property on non-object in /in/CGouK on line 12 Notice: Cannot access property on non-object in /in/CGouK on line 12
Output for 5.1.0 - 5.2.5
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/CGouK on line 6 Warning: simplexml_load_file(http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys): failed to open stream: Connection refused in /in/CGouK on line 6 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" in /in/CGouK on line 6 bool(false) Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12
Output for 5.0.3 - 5.0.5
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/CGouK on line 6 Warning: simplexml_load_file(http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("INRUSD")&diagnostics=true&env=store://datatables.org/alltableswithkeys): failed to open stream: Connection refused in /in/CGouK on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" in /in/CGouK on line 6 bool(false) Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12
Output for 5.0.1 - 5.0.2
Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/CGouK on line 6 Warning: simplexml_load_file(http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("INRUSD")&diagnostics=true&env=store://datatables.org/alltableswithkeys): failed to open stream: Success in /in/CGouK on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" in /in/CGouK on line 6 bool(false) Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12
Output for 5.0.0
Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/CGouK on line 6 Warning: simplexml_load_file(http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("INRUSD")&diagnostics=true&env=store://datatables.org/alltableswithkeys): failed to open stream: Bad file descriptor in /in/CGouK on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22INRUSD%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" in /in/CGouK on line 6 bool(false) Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12 Notice: Trying to get property of non-object in /in/CGouK on line 12
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_file() in /in/CGouK on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_file() in /in/CGouK on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_file() in /in/CGouK on line 6