3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit
Warning: Undefined variable $output in /in/NQljQ on line 4 Warning: Trying to access array offset on value of type null in /in/NQljQ on line 4 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/NQljQ on line 9 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json?start_date=2015-12-16) is not within the allowed path(s): (/tmp:/in:/etc) 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: Operation not permitted in /in/NQljQ on line 9 Warning: Trying to access array offset on value of type null in /in/NQljQ on line 11 Warning: Trying to access array offset on value of type null in /in/NQljQ on line 11 Warning: Trying to access array offset on value of type null in /in/NQljQ on line 11 Warning: Trying to access array offset on value of type null in /in/NQljQ on line 11 Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /in/NQljQ on line 14 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/NQljQ on line 14
Output for rfc.property-hooks
Warning: Undefined variable $output in /in/NQljQ on line 4 Warning: Trying to access array offset on null in /in/NQljQ on line 4 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/NQljQ on line 9 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.quandl.com/api/v3/datasets/WSJ/AU_HHB.json?start_date=2015-12-16) is not within the allowed path(s): (/tmp:/in:/etc) 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: Operation not permitted in /in/NQljQ on line 9 Warning: Trying to access array offset on null in /in/NQljQ on line 11 Warning: Trying to access array offset on null in /in/NQljQ on line 11 Warning: Trying to access array offset on null in /in/NQljQ on line 11 Warning: Trying to access array offset on null in /in/NQljQ on line 11 Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /in/NQljQ on line 14 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/NQljQ on line 14

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.5 ms | 403 KiB | 8 Q