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/Pb2pO
function name:  (null)
number of ops:  26
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  ~11     !2
          8        ROPE_ADD                                      1  ~11     ~11, '-%3E'
          9        FETCH_DIM_R                                      ~9      !0, !1
         10        ROPE_ADD                                      2  ~11     ~11, ~9
         11        ROPE_END                                      3  ~10     ~11, '%0A'
         12        ECHO                                                     ~10
    7    13        FETCH_DIM_R                                      ~13     !0, !1
         14        FETCH_OBJ_R                                      ~14     !2, ~13
         15        NOP                                                      
         16        FAST_CONCAT                                      ~15     ~14, '%0A'
         17        ECHO                                                     ~15
    8    18        FETCH_CONSTANT                                   ~16     'data'
         19        FETCH_R                      local               ~17     ~16
         20        FETCH_DIM_R                                      ~18     ~17, !1
         21        FETCH_OBJ_R                                      ~19     !2, ~18
         22        NOP                                                      
         23        FAST_CONCAT                                      ~20     ~19, '%0A'
         24        ECHO                                                     ~20
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.72 ms | 1398 KiB | 13 Q