3v4l.org

run code in 300+ PHP versions simultaneously
<?php function BitBay_Trading_Api($method, $params = array()) { $key = "123"; $secret = "321"; $params["method"] = "info"; $params["moment"] = time(); $post = http_build_query($params, "", "&"); $sign = hash_hmac("sha512", $post, $secret); $headers = array( "API-Key: " . $key, "API-Hash: " . $sign, ); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, "https://bitbay.net/API/Trading/tradingApi.php"); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //$ret = curl_exec($curl); // return $ret; return $params["method"]; }
Output for 7.0.0 - 7.0.25, 7.1.0 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.12

preferences:
117.36 ms | 402 KiB | 91 Q