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 $obj [$nam]; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uk3O2
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
    3     4        ASSIGN                                                   !1, 'name'
    4     5        INIT_FCALL                                               'json_encode'
          6        FETCH_OBJ_R                                      ~7      !0, 'data'
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    5    10        ECHO                                                     !2
    6    11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
    7    16        FETCH_DIM_R                                      ~12     !0, !1
         17        ECHO                                                     ~12
    9    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.98 ms | 1394 KiB | 17 Q