3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ["foo"=>"bar"]; $key = "foo"; $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/TAZnS
function name:  (null)
number of ops:  23
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        ASSIGN_OBJ                                               !2, 'bar'
          3        OP_DATA                                                  'xyz'
    5     4        ROPE_INIT                                     4  ~8      !2
          5        ROPE_ADD                                      1  ~8      ~8, '-%3E'
          6        FETCH_DIM_R                                      ~6      !0, !1
          7        ROPE_ADD                                      2  ~8      ~8, ~6
          8        ROPE_END                                      3  ~7      ~8, '%0A'
          9        ECHO                                                     ~7
    6    10        FETCH_DIM_R                                      ~10     !0, !1
         11        FETCH_OBJ_R                                      ~11     !2, ~10
         12        NOP                                                      
         13        FAST_CONCAT                                      ~12     ~11, '%0A'
         14        ECHO                                                     ~12
    7    15        FETCH_CONSTANT                                   ~13     'data'
         16        FETCH_R                      local               ~14     ~13
         17        FETCH_DIM_R                                      ~15     ~14, !1
         18        FETCH_OBJ_R                                      ~16     !2, ~15
         19        NOP                                                      
         20        FAST_CONCAT                                      ~17     ~16, '%0A'
         21        ECHO                                                     ~17
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1394 KiB | 13 Q