3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? $url = 'http://auctionlook-dev.azurewebsites.net/api/auctions/KY'; // Initialize the cURL session with the request URL $session = curl_init($url); // Tell cURL to return the request data curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Set the HTTP request authentication headers $headers = array( 'DecibelAppID: ' . $applicationID, 'DecibelAppKey: ' . $applicationKey, 'DecibelTimestamp: ' . date('Ymd H:i:s', time()) ); curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // Execute cURL on the session handle $response = curl_exec($session); echo $response; $convertedresponse = json_decode($response, true); echo "---------------------------------------------------------------"; print_r($convertedresponse); echo '<pre>'; print_r($convertedresponse); echo '</pre>'; // Close the cURL session curl_close($session);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uNfEQ:4 Stack trace: #0 {main} thrown in /in/uNfEQ on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/uNfEQ on line 4
Process exited with code 255.
Output for 4.3.0 - 5.3.29
<? $url = 'http://auctionlook-dev.azurewebsites.net/api/auctions/KY'; // Initialize the cURL session with the request URL $session = curl_init($url); // Tell cURL to return the request data curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Set the HTTP request authentication headers $headers = array( 'DecibelAppID: ' . $applicationID, 'DecibelAppKey: ' . $applicationKey, 'DecibelTimestamp: ' . date('Ymd H:i:s', time()) ); curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // Execute cURL on the session handle $response = curl_exec($session); echo $response; $convertedresponse = json_decode($response, true); echo "---------------------------------------------------------------"; print_r($convertedresponse); echo '<pre>'; print_r($convertedresponse); echo '</pre>'; // Close the cURL session curl_close($session);