3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $bar = 'baz'; } $x = 'bar'; $o = new foo(); echo $o->$x; echo $o->{$x}; echo get_object_vars($o)[$x];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aJm0E
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'bar'
    8     1        NEW                                              $3      'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
    9     4        FETCH_OBJ_R                                      ~6      !1, !0
          5        ECHO                                                     ~6
   10     6        FETCH_OBJ_R                                      ~7      !1, !0
          7        ECHO                                                     ~7
   11     8        INIT_FCALL                                               'get_object_vars'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        FETCH_DIM_R                                      ~9      $8, !0
         12        ECHO                                                     ~9
         13      > RETURN                                                   1

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.64 ms | 1394 KiB | 15 Q