3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Get the original answer $answer = $output['answer']; // Get gold price from external API // // https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json $start_date = date('Y-m-d', strtotime('-3 days')); $json_string = file_get_contents("https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json?start_date=$start_date"); $json_object = json_decode($json_string,true); $gold_price = $json_object['dataset']['data'][0]['1']; // Update the answer by filling the gap XXXX with the actual value of gold $answer = str_replace('XXXX', $gold_price , $answer); // send the answer to Alexa $output['answer'] = $answer; ?>
Output for 7.0.20, 7.1.5 - 7.2.0
Notice: Undefined variable: output in /in/NQljQ on line 4 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/NQljQ on line 9 Warning: file_get_contents(https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json?start_date=2015-12-16): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/NQljQ on line 9
Output for 5.5.0 - 7.0.10, 7.1.0
Notice: Undefined variable: output in /in/NQljQ on line 4 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/NQljQ on line 9 Warning: file_get_contents(https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json?start_date=2015-12-16): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/NQljQ on line 9