3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' { "routes": [ { "bounds": { "northeast": { "lat": 41.9291739, "lng": 23.7293099 }, "southwest": { "lat": 37.9103506, "lng": 12.4822041 } }, "copyrights": "Map data,google", "legs": [ { "distance": { "text": "1,250 km", "value": 1249958 } } ] } ] } '; $json = json_decode($str); $distance = $json[routes][legs][distance][value]; var_dump($distance);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAFLV
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $json, !2 = $distance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '++++%7B%0A++++%22routes%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22bounds%22%3A+%7B%0A++++++++++++++++%22northeast%22%3A+%7B%0A++++++++++++++++++++%22lat%22%3A+41.9291739%2C%0A++++++++++++++++++++%22lng%22%3A+23.7293099%0A++++++++++++++++%7D%2C%0A++++++++++++++++%22southwest%22%3A+%7B%0A++++++++++++++++++++%22lat%22%3A+37.9103506%2C%0A++++++++++++++++++++%22lng%22%3A+12.4822041%0A++++++++++++++++%7D%0A++++++++++++%7D%2C%0A++++++++++++%22copyrights%22%3A+%22Map+data%2Cgoogle%22%2C%0A++++++++++++%22legs%22%3A+%5B%0A++++++++++++++++%7B%0A++++++++++++++++++++%22distance%22%3A+%7B%0A++++++++++++++++++++++++%22text%22%3A+%221%2C250+km%22%2C%0A++++++++++++++++++++++++%22value%22%3A+1249958%0A++++++++++++++++++++%7D%0A++++++++++++++++%7D%0A++++++++++++%5D%0A++++++++%7D%0A++++%5D%0A%7D%0A'
   29     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   30     5        FETCH_CONSTANT                                   ~6      'routes'
          6        FETCH_CONSTANT                                   ~8      'legs'
          7        FETCH_CONSTANT                                   ~10     'distance'
          8        FETCH_CONSTANT                                   ~12     'value'
          9        FETCH_DIM_R                                      ~7      !1, ~6
         10        FETCH_DIM_R                                      ~9      ~7, ~8
         11        FETCH_DIM_R                                      ~11     ~9, ~10
         12        FETCH_DIM_R                                      ~13     ~11, ~12
         13        ASSIGN                                                   !2, ~13
   31    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.69 ms | 1395 KiB | 17 Q