3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $myAddress = "15502 S Memorial Dr, Bixby, OK 74445"; $myKey = "Fmjtd%7Cluu82q6y2q%2Can%3Do5-94txl0"; function GetJsonFeed() { global $myAddress, $myKey; //$url = "http://www.mapquestapi.com/geocoding/v1/address?key=" . $myKey . "&callback=renderOptions&inFormat=kvp&outFormat=json&location=" . $myAddress . "&maxResults=1"; $url = @file_get_contents('http://open.mapquestapi.com/geocoding/v1/address?key=' . $myKey . '&location=Lancaster,PA'); echo $url . "<br>"; $mapresponse = file_get_contents(rawurlencode($url), "r"); return json_decode($mapresponse); } $json = GetJsonFeed(); $jsonArr = json_decode($json); var_dump(json_decode($json, true)); ?>
based on sJce8
Output for 5.2.9 - 7.2.0
<br> Warning: file_get_contents(): Filename cannot be empty in /in/Tm8At on line 11 NULL
Output for 5.2.0 - 5.2.8
<br>NULL
Output for 5.0.0 - 5.1.6
<br> Fatal error: Call to undefined function json_decode() in /in/Tm8At on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br> Fatal error: Call to undefined function: json_decode() in /in/Tm8At on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<br> Fatal error: Call to undefined function: json_decode() in /in/Tm8At on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br> Fatal error: Call to undefined function: json_decode() in /in/Tm8At on line 12