3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ["foo"=>"bar"]; $key = "foo"; $obj = new stdClass; $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/LPSak
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $key, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'foo'
    4     2        NEW                                              $5      'stdClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $5
    5     5        ASSIGN_OBJ                                               !2, 'bar'
          6        OP_DATA                                                  'xyz'
    6     7        FETCH_DIM_R                                      ~9      !0, !1
          8        FETCH_OBJ_R                                      ~10     !2, ~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, !1
         15        FETCH_OBJ_R                                      ~15     !2, ~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:
176.41 ms | 1398 KiB | 13 Q