3v4l.org

run code in 300+ PHP versions simultaneously
<?php // some address values $client_address = '11010 Langton Arms Court'; $client_city = 'Oakton'; $client_state = 'VA'; $client_zip = '22124'; // building the JSON URL string for Google API call $g_address = str_replace(' ', '+', trim($client_address)).","; $g_city = '+'.str_replace(' ', '+', trim($client_city)).","; $g_state = '+'.str_replace(' ', '+', trim($client_state)); $g_zip = isset($client_zip)? '+'.str_replace(' ', '', trim($client_zip)) : ''; $g_addr_str = $g_address.$g_city.$g_state.$g_zip; $url = "http://maps.google.com/maps/api/geocode/json? address=$g_addr_str"; // Parsing the JSON response from the Google Geocode API to get exact map coordinates: // latitude , longitude (see the Google doc. for the complete data return here: // https://developers.google.com/maps/documentation/geocoding/.) $jsonData = file_get_contents($url); $data = json_decode($jsonData); $xlat = $data->{'results'}[0]->{'geometry'}->{'location'}->{'lat'}; $xlong = $data->{'results'}[0]->{'geometry'}->{'location'}->{'lng'}; echo $xlat.",".$xlong;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 48
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tPXWE
function name:  (null)
number of ops:  81
compiled vars:  !0 = $client_address, !1 = $client_city, !2 = $client_state, !3 = $client_zip, !4 = $g_address, !5 = $g_city, !6 = $g_state, !7 = $g_zip, !8 = $g_addr_str, !9 = $url, !10 = $jsonData, !11 = $data, !12 = $xlat, !13 = $xlong
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '11010+Langton+Arms+Court'
    5     1        ASSIGN                                                   !1, 'Oakton'
    6     2        ASSIGN                                                   !2, 'VA'
    7     3        ASSIGN                                                   !3, '22124'
   10     4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 '+'
          6        SEND_VAL                                                 '%2B'
          7        INIT_FCALL                                               'trim'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $18     
         10        SEND_VAR                                                 $18
         11        DO_ICALL                                         $19     
         12        CONCAT                                           ~20     $19, '%2C'
         13        ASSIGN                                                   !4, ~20
   11    14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '+'
         16        SEND_VAL                                                 '%2B'
         17        INIT_FCALL                                               'trim'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $22     
         20        SEND_VAR                                                 $22
         21        DO_ICALL                                         $23     
         22        CONCAT                                           ~24     '%2B', $23
         23        CONCAT                                           ~25     ~24, '%2C'
         24        ASSIGN                                                   !5, ~25
   12    25        INIT_FCALL                                               'str_replace'
         26        SEND_VAL                                                 '+'
         27        SEND_VAL                                                 '%2B'
         28        INIT_FCALL                                               'trim'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $27     
         31        SEND_VAR                                                 $27
         32        DO_ICALL                                         $28     
         33        CONCAT                                           ~29     '%2B', $28
         34        ASSIGN                                                   !6, ~29
   13    35        ISSET_ISEMPTY_CV                                         !3
         36      > JMPZ                                                     ~31, ->48
         37    >   INIT_FCALL                                               'str_replace'
         38        SEND_VAL                                                 '+'
         39        SEND_VAL                                                 ''
         40        INIT_FCALL                                               'trim'
         41        SEND_VAR                                                 !3
         42        DO_ICALL                                         $32     
         43        SEND_VAR                                                 $32
         44        DO_ICALL                                         $33     
         45        CONCAT                                           ~34     '%2B', $33
         46        QM_ASSIGN                                        ~35     ~34
         47      > JMP                                                      ->49
         48    >   QM_ASSIGN                                        ~35     ''
         49    >   ASSIGN                                                   !7, ~35
   15    50        CONCAT                                           ~37     !4, !5
         51        CONCAT                                           ~38     ~37, !6
         52        CONCAT                                           ~39     ~38, !7
         53        ASSIGN                                                   !8, ~39
   16    54        NOP                                                      
   17    55        FAST_CONCAT                                      ~41     'http%3A%2F%2Fmaps.google.com%2Fmaps%2Fapi%2Fgeocode%2Fjson%3F%0A++++++++address%3D', !8
   16    56        ASSIGN                                                   !9, ~41
   23    57        INIT_FCALL                                               'file_get_contents'
         58        SEND_VAR                                                 !9
         59        DO_ICALL                                         $43     
         60        ASSIGN                                                   !10, $43
   25    61        INIT_FCALL                                               'json_decode'
         62        SEND_VAR                                                 !10
         63        DO_ICALL                                         $45     
         64        ASSIGN                                                   !11, $45
   27    65        FETCH_OBJ_R                                      ~47     !11, 'results'
         66        FETCH_DIM_R                                      ~48     ~47, 0
         67        FETCH_OBJ_R                                      ~49     ~48, 'geometry'
         68        FETCH_OBJ_R                                      ~50     ~49, 'location'
         69        FETCH_OBJ_R                                      ~51     ~50, 'lat'
         70        ASSIGN                                                   !12, ~51
   28    71        FETCH_OBJ_R                                      ~53     !11, 'results'
         72        FETCH_DIM_R                                      ~54     ~53, 0
         73        FETCH_OBJ_R                                      ~55     ~54, 'geometry'
         74        FETCH_OBJ_R                                      ~56     ~55, 'location'
         75        FETCH_OBJ_R                                      ~57     ~56, 'lng'
         76        ASSIGN                                                   !13, ~57
   30    77        CONCAT                                           ~59     !12, '%2C'
         78        CONCAT                                           ~60     ~59, !13
         79        ECHO                                                     ~60
         80      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.16 ms | 1400 KiB | 21 Q