3v4l.org

run code in 300+ PHP versions simultaneously
<?php $username = 'stn'; $password = '$ta7$T5d'; $url = 'https://purpleportal.net/api/location/v1/ping'; $token = base64_encode($username . ':' . $password); $curl = curl_init(); $headers = [ "Content-Type: application/json", "Authorization: basic " . $token, ]; curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => true, CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers ]); $output = curl_exec($curl); // $info = curl_getinfo($curl, CURLINFO_HTTP_CODE); // var_dump($info); var_dump($output);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/3HtOl:7 Stack trace: #0 {main} thrown in /in/3HtOl on line 7
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/3HtOl on line 7
Process exited with code 255.

preferences:
200.08 ms | 405 KiB | 228 Q