3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass(); $a->{0} = 'X'; $a->{1} = 'Y'; var_dump($a); $x = unserialize(serialize($a)); $prop = 1; var_dump($x->{"1"}, $x->$x->$prop, $x->${"$prop"});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UcqQW
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $x, !2 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        ASSIGN_OBJ                                               !0, '0'
          4        OP_DATA                                                  'X'
    4     5        ASSIGN_OBJ                                               !0, '1'
          6        OP_DATA                                                  'Y'
    5     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    6    10        INIT_FCALL                                               'unserialize'
         11        INIT_FCALL                                               'serialize'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !1, $10
    7    17        ASSIGN                                                   !2, 1
    8    18        INIT_FCALL                                               'var_dump'
         19        FETCH_OBJ_R                                      ~13     !1, '1'
         20        SEND_VAL                                                 ~13
         21        FETCH_OBJ_R                                      ~14     !1, !1
         22        FETCH_OBJ_R                                      ~15     ~14, !2
         23        SEND_VAL                                                 ~15
         24        CAST                                          6  ~16     !2
         25        FETCH_R                      local               ~17     ~16
         26        FETCH_OBJ_R                                      ~18     !1, ~17
         27        SEND_VAL                                                 ~18
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.95 ms | 1400 KiB | 19 Q