3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://maps.google.com/maps/api/geocode/json?address=Bahnhofstra%C3%9Fe+19+Gr%C3%A4fenhainichen&components=country:NL'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $data = curl_exec($ch); // $data = json_decode($data); var_dump($data); if (!curl_errno($ch) && isset($data->status) && ($data->status == 'OK')) { // $latitude = $data->result[0]->geometry->location->lat; // $longitude = $data->result[0]->geometry->location->lng; // if ($dealers = User::findDealersByCoordinates($longitude, $latitude, $country->id)) { // $dealerId = $dealers[0]['dealerID']; // $websiteId = $dealers[0]['websiteID']; // } } else { // Yii::error('Curl request at Google API timeout'); } curl_close($ch);
based on GJG1V
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uF9Hq:5 Stack trace: #0 {main} thrown in /in/uF9Hq on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/uF9Hq on line 5
Process exited with code 255.