3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new stdClass(); $data = ["foo"=>"bar"]; $key = "foo"; $obj->bar = "xyz"; echo "{$obj->{ ${'data'}[$key] }}\n"; echo "{$obj->{ ${data}[$key] }}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IVJqY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $obj, !1 = $data, !2 = $key
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                                                   !1, <array>
    4     4        ASSIGN                                                   !2, 'foo'
    5     5        ASSIGN_OBJ                                               !0, 'bar'
          6        OP_DATA                                                  'xyz'
    6     7        FETCH_DIM_R                                      ~9      !1, !2
          8        FETCH_OBJ_R                                      ~10     !0, ~9
          9        NOP                                                      
         10        FAST_CONCAT                                      ~11     ~10, '%0A'
         11        ECHO                                                     ~11
    7    12        FETCH_CONSTANT                                   ~12     'data'
         13        FETCH_R                      local               ~13     ~12
         14        FETCH_DIM_R                                      ~14     ~13, !2
         15        FETCH_OBJ_R                                      ~15     !0, ~14
         16        NOP                                                      
         17        FAST_CONCAT                                      ~16     ~15, '%0A'
         18        ECHO                                                     ~16
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.14 ms | 1393 KiB | 13 Q