3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ip = $_SERVER['REMOTE_ADDR']; echo $ip; $url = "http://geoip.nekudo.com/api/" . urlencode($ip); $content = file_get_contents($url); $json = json_decode($content); $lat = $json->location->latitude; $long = $json->location->longitude; ?> <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCKpthp6RdaCNWy83Arx5N6LvwgLYMF2H4"></script> <script> function initialize() { var mapProp = { center:new google.maps.LatLng(51.508742,-0.120850), zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("map"),mapProp); } google.maps.event.addDomListener(window, 'load', initialize); </script> <div align="center" class="map"> </div>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "REMOTE_ADDR" in /in/P3CUv on line 3 Deprecated: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/P3CUv on line 6 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for geoip.nekudo.com failed: System error in /in/P3CUv on line 7 Warning: file_get_contents(http://geoip.nekudo.com/api/): Failed to open stream: php_network_getaddresses: getaddrinfo for geoip.nekudo.com failed: System error in /in/P3CUv on line 7 Warning: Attempt to read property "location" on null in /in/P3CUv on line 10 Warning: Attempt to read property "latitude" on null in /in/P3CUv on line 10 Warning: Attempt to read property "location" on null in /in/P3CUv on line 11 Warning: Attempt to read property "longitude" on null in /in/P3CUv on line 11 <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCKpthp6RdaCNWy83Arx5N6LvwgLYMF2H4"></script> <script> function initialize() { var mapProp = { center:new google.maps.LatLng(51.508742,-0.120850), zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("map"),mapProp); } google.maps.event.addDomListener(window, 'load', initialize); </script> <div align="center" class="map"> </div>

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:
55.11 ms | 404 KiB | 8 Q