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>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P3CUv
function name:  (null)
number of ops:  25
compiled vars:  !0 = $ip, !1 = $url, !2 = $content, !3 = $json, !4 = $lat, !5 = $long
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_R                      global              ~6      '_SERVER'
          1        FETCH_DIM_R                                      ~7      ~6, 'REMOTE_ADDR'
          2        ASSIGN                                                   !0, ~7
    4     3        ECHO                                                     !0
    6     4        INIT_FCALL                                               'urlencode'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7        CONCAT                                           ~10     'http%3A%2F%2Fgeoip.nekudo.com%2Fapi%2F', $9
          8        ASSIGN                                                   !1, ~10
    7     9        INIT_FCALL                                               'file_get_contents'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !2, $12
    8    13        INIT_FCALL                                               'json_decode'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !3, $14
   10    17        FETCH_OBJ_R                                      ~16     !3, 'location'
         18        FETCH_OBJ_R                                      ~17     ~16, 'latitude'
         19        ASSIGN                                                   !4, ~17
   11    20        FETCH_OBJ_R                                      ~19     !3, 'location'
         21        FETCH_OBJ_R                                      ~20     ~19, 'longitude'
         22        ASSIGN                                                   !5, ~20
   14    23        ECHO                                                     '%0A%3Cscript+src%3D%22http%3A%2F%2Fmaps.googleapis.com%2Fmaps%2Fapi%2Fjs%3Fkey%3DAIzaSyCKpthp6RdaCNWy83Arx5N6LvwgLYMF2H4%22%3E%3C%2Fscript%3E%0A%3Cscript%3E%0Afunction+initialize%28%29+%7B%0A++var+mapProp+%3D+%7B%0A++++center%3Anew+google.maps.LatLng%2851.508742%2C-0.120850%29%2C%0A++++zoom%3A5%2C%0A++++mapTypeId%3Agoogle.maps.MapTypeId.ROADMAP%0A++%7D%3B%0A++var+map%3Dnew+google.maps.Map%28document.getElementById%28%22map%22%29%2CmapProp%29%3B%0A%7D%0Agoogle.maps.event.addDomListener%28window%2C+%27load%27%2C+initialize%29%3B%0A%3C%2Fscript%3E%0A%0A+%3Cdiv+align%3D%22center%22+class%3D%22map%22%3E%0A%0A+%3C%2Fdiv%3E'
   30    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
198.33 ms | 1400 KiB | 19 Q