3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLnt($zip){ $url = "http://maps.googleapis.com/maps/api/geocode/json?address= ".urlencode($zip)."&sensor=false"; $result_string = file_get_contents($url); $result = json_decode($result_string, true); return $result['results'][0]['geometry']['location']; } $val = getLnt('75204'); echo "Latitude: ".$val['lat']."<br>"; echo "Longitude: ".$val['lng']."<br>"; ?>
Output for git.master, git.master_jit
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for maps.googleapis.com failed: System error in /in/RQKKq on line 5 Warning: file_get_contents(http://maps.googleapis.com/maps/api/geocode/json?address= 75204&sensor=false): Failed to open stream: php_network_getaddresses: getaddrinfo for maps.googleapis.com failed: System error in /in/RQKKq on line 5 Warning: Trying to access array offset on value of type null in /in/RQKKq on line 7 Warning: Trying to access array offset on value of type null in /in/RQKKq on line 7 Warning: Trying to access array offset on value of type null in /in/RQKKq on line 7 Warning: Trying to access array offset on value of type null in /in/RQKKq on line 7 Warning: Trying to access array offset on value of type null in /in/RQKKq on line 10 Latitude: <br> Warning: Trying to access array offset on value of type null in /in/RQKKq on line 11 Longitude: <br>
Output for rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for maps.googleapis.com failed: System error in /in/RQKKq on line 5 Warning: file_get_contents(http://maps.googleapis.com/maps/api/geocode/json?address= 75204&sensor=false): Failed to open stream: php_network_getaddresses: getaddrinfo for maps.googleapis.com failed: System error in /in/RQKKq on line 5 Warning: Trying to access array offset on null in /in/RQKKq on line 7 Warning: Trying to access array offset on null in /in/RQKKq on line 7 Warning: Trying to access array offset on null in /in/RQKKq on line 7 Warning: Trying to access array offset on null in /in/RQKKq on line 7 Warning: Trying to access array offset on null in /in/RQKKq on line 10 Latitude: <br> Warning: Trying to access array offset on null in /in/RQKKq on line 11 Longitude: <br>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.36 ms | 402 KiB | 8 Q