3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = new stdClass(); $class->field = 'foo'; var_dump($class); $array = array(1 => $class); var_dump($array); $json_sting = json_encode($array); var_dump($json_sting); $array_obj = json_decode($json_sting); var_dump($array_obj); $array = (array) $array_obj; var_dump($array); var_dump($array[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RoV0N
function name:  (null)
number of ops:  37
compiled vars:  !0 = $class, !1 = $array, !2 = $json_sting, !3 = $array_obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    5     3        ASSIGN_OBJ                                               !0, 'field'
          4        OP_DATA                                                  'foo'
    6     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    7     8        INIT_ARRAY                                       ~9      !0, 1
          9        ASSIGN                                                   !1, ~9
    8    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !2, $12
   10    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   11    20        INIT_FCALL                                               'json_decode'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !3, $15
   12    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
   13    27        CAST                                          7  ~18     !3
         28        ASSIGN                                                   !1, ~18
   14    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                                 
   15    32        INIT_FCALL                                               'var_dump'
         33        FETCH_DIM_R                                      ~21     !1, 1
         34        SEND_VAL                                                 ~21
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.11 ms | 1401 KiB | 19 Q