3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj =json_decode('{"data":{"name":"karla"}}'); $nam = "name";$str = json_encode($obj->data);echo $str;$arr = json_decode($str,true);echo $arr[$nam]; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8GQj
function name:  (null)
number of ops:  19
compiled vars:  !0 = $obj, !1 = $nam, !2 = $str, !3 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22data%22%3A%7B%22name%22%3A%22karla%22%7D%7D'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
          4        ASSIGN                                                   !1, 'name'
          5        INIT_FCALL                                               'json_encode'
          6        FETCH_OBJ_R                                      ~7      !0, 'data'
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
         10        ECHO                                                     !2
         11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
         16        FETCH_DIM_R                                      ~12     !3, !1
         17        ECHO                                                     ~12
    4    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.04 ms | 1394 KiB | 17 Q