3v4l.org

run code in 300+ PHP versions simultaneously
<?php phpversion() >= "7.0.1" or die(); $obj = new stdClass(); $obj->bar = "xyz"; $data = array("foo" => "bar"); $key = "foo"; var_dump($obj->$data); echo $obj->{$data[$key]};
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6m9RM
function name:  (null)
number of ops:  21
compiled vars:  !0 = $obj, !1 = $data, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $3      
          2        IS_SMALLER_OR_EQUAL                              ~4      '7.0.1', $3
          3      > JMPNZ_EX                                         ~4      ~4, ->6
          4    > > EXIT                                                     
          5*       BOOL                                             ~4      <true>
    4     6    >   NEW                                              $5      'stdClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $5
    5     9        ASSIGN_OBJ                                               !0, 'bar'
         10        OP_DATA                                                  'xyz'
    6    11        ASSIGN                                                   !1, <array>
    7    12        ASSIGN                                                   !2, 'foo'
    8    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~11     !0, !1
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
    9    17        FETCH_DIM_R                                      ~13     !1, !2
         18        FETCH_OBJ_R                                      ~14     !0, ~13
         19        ECHO                                                     ~14
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1395 KiB | 17 Q