3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Your Site Settings $site_public_key = 'X'; $site_private_key = 'X'; //Connection Resource $resource_uri = 'https://api.lkqd.com/reports'; $body = '{ "timeDimension": "HOURLY", // OVERALL, DAILY, HOURLY "reportType": ["PARTNER"], // Up to 3 dimensions among OVERVIEW, PARTNER, DOMAIN, APP_NAME, SITE, SOURCE, DEAL, TAG, FORMAT, COUNTRY, CUSTOM1, CUSTOM2, CUSTOM3, OS, DEVICE, PLAYER_WIDTH_HEIGHT "reportFormat": "JSON", // JSON, CSV "startDate": "2015-01-08", // Required, These are in America/New_York timezone by default "endDate": "2015-01-09", // Required, These are in America/New_York timezone by default "startHour": 5, // Optional, only meaningful for HOURLY time dimension, must be Int (not String) //"endHour": 19, // Optional, only meaningful for HOURLY time dimension, must be Int (not String) "timezone": "UTC", // "UTC" and "America/New_York" currently supported "sort": [{ "field": "field_name1", // field_name1, field_name2, field_name3, ad_requests, ad_impressions, ad_fill_rate, ad_cpm, ad_revenue, ad_ctr, ad_vtr "order": "desc" // asc, desc }], // "limit": 100, // default is unlimited //"offset": 300 // default 0 }'; //Setup connection $curl = curl_init($resource_uri); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Authorization: xxxx")); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $body); curl_setopt($curl, CURLOPT_USERPWD, $site_public_key . ":" . $site_private_key); //Send request $result_json = curl_exec($curl); curl_close($curl); //Done print_r($result_json); $responseData = json_decode($response, TRUE); print_r($responseData); ?>
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/Gj11T:28 Stack trace: #0 {main} thrown in /in/Gj11T on line 28
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/Gj11T on line 28
Process exited with code 255.

preferences:
176.26 ms | 402 KiB | 228 Q