3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //this reads 3hr PSI RSS feed from NEA $Output_3hr = ""; $url_3hr = "http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml"; $xml_3hr = simplexml_load_file($url_3hr); for($i=0; $i<10; $i++){ $value_3hr = $xml_3hr->rss->channel->item[$i]->psi; $Output_3hr .= "<p>$value_3hr</p>"; } echo $Output_3hr; ?>
based on MpDgB
Output for 7.2.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/5ocaR on line 4 Warning: simplexml_load_file(http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/5ocaR on line 4 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml" in /in/5ocaR on line 4 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'rss' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'channel' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'item' of non-object in /in/5ocaR on line 6 Notice: Trying to get property 'psi' of non-object in /in/5ocaR on line 6 <p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
Output for 5.3.19 - 5.4.45, 5.5.32 - 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.1.10
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/5ocaR on line 4 Warning: simplexml_load_file(http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/5ocaR on line 4 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml" in /in/5ocaR on line 4 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 <p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/5ocaR on line 4 Warning: simplexml_load_file(http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/5ocaR on line 4 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://wip.weather.gov.sg/wip/pp/rndops/web/rss/rssHeavyRain_new.xml" in /in/5ocaR on line 4 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 Notice: Trying to get property of non-object in /in/5ocaR on line 6 <p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>