3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'APIKEY'; $secret = 'APISECRET'; $timestamp = time(); $signature = hash_hmac('sha1', "timestamp=".$timestamp, $secret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.domain.com/getticker"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "timestamp=".time()); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded","key: ".$key,"sig: ".$signature)); $response = curl_exec($ch); curl_close($ch); echo $response;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.12
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/2dCgP:9 Stack trace: #0 {main} thrown in /in/2dCgP on line 9
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.25
Fatal error: Call to undefined function curl_init() in /in/2dCgP on line 9
Process exited with code 255.

preferences:
116.87 ms | 402 KiB | 134 Q