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"; echo "{$obj->{ ${data}[$key] }}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EkvkY
function name:  (null)
number of ops:  28
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        ROPE_INIT                                     4  ~13     !2
          8        ROPE_ADD                                      1  ~13     ~13, '-%3E'
          9        FETCH_CONSTANT                                   ~9      'data'
         10        FETCH_DIM_R                                      ~10     ~9, !1
         11        FETCH_R                      local               ~11     ~10
         12        ROPE_ADD                                      2  ~13     ~13, ~11
         13        ROPE_END                                      3  ~12     ~13, '%0A'
         14        ECHO                                                     ~12
    7    15        FETCH_DIM_R                                      ~15     !0, !1
         16        FETCH_OBJ_R                                      ~16     !2, ~15
         17        NOP                                                      
         18        FAST_CONCAT                                      ~17     ~16, '%0A'
         19        ECHO                                                     ~17
    8    20        FETCH_CONSTANT                                   ~18     'data'
         21        FETCH_R                      local               ~19     ~18
         22        FETCH_DIM_R                                      ~20     ~19, !1
         23        FETCH_OBJ_R                                      ~21     !2, ~20
         24        NOP                                                      
         25        FAST_CONCAT                                      ~22     ~21, '%0A'
         26        ECHO                                                     ~22
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.2 ms | 1398 KiB | 13 Q