3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! $url = "http://openexchangerates.org/api/latest.json?app_id=d4c39d762a1f47ee8917d7b5d380365c&base=EUR&symbols=USD"; $rawData = file_get_contents($url); if (!$rawData) echo "null<br>"; $response = json_decode($rawData, true); if (!isset($response["rates"])) echo "nullnull<br>"; var_dump($response);
Output for 5.3.0 - 5.6.30, 7.0.0 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/PSJFh on line 4 Warning: file_get_contents(http://openexchangerates.org/api/latest.json?app_id=d4c39d762a1f47ee8917d7b5d380365c&base=EUR&symbols=USD): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/PSJFh on line 4 null<br>nullnull<br>NULL
Output for hhvm-3.10.1 - 3.17.3
Warning: Failed to open http://openexchangerates.org/api/latest.json?app_id=d4c39d762a1f47ee8917d7b5d380365c&base=EUR&symbols=USD (Could not resolve host: openexchangerates.org) in /in/PSJFh on line 4 null<br>nullnull<br>NULL