3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); ?>
based on aW4aW
Output for 7.0.0 - 7.2.0
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.3.18 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/Gj11T on line 28
Process exited with code 255.