3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new stdClass(); $obj->bar = "xyz"; $data = array("foo" => "bar"); $key = "foo"; // the good: without and within a string echo $obj->{$data[$key]}; echo "{$obj->{$data[$key]}}"; // the bad: try { echo @$obj->${data[$key]}; // syntax error } catch (Error $e){ echo $e->getMessage(),"\n"; } // complex curly brace syntax: without and within a string echo $obj->{${'data'}[$key]}; echo "{$obj->{${'data'}[$key]}}";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m8WEh
function name:  (null)
number of ops:  35
compiled vars:  !0 = $obj, !1 = $data, !2 = $key, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        ASSIGN_OBJ                                               !0, 'bar'
          4        OP_DATA                                                  'xyz'
    5     5        ASSIGN                                                   !1, <array>
    6     6        ASSIGN                                                   !2, 'foo'
    9     7        FETCH_DIM_R                                      ~10     !1, !2
          8        FETCH_OBJ_R                                      ~11     !0, ~10
          9        ECHO                                                     ~11
   10    10        FETCH_DIM_R                                      ~12     !1, !2
         11        FETCH_OBJ_R                                      ~13     !0, ~12
         12        CAST                                          6  ~14     ~13
         13        ECHO                                                     ~14
   14    14        BEGIN_SILENCE                                    ~15     
         15        FETCH_CONSTANT                                   ~16     'data'
         16        FETCH_DIM_R                                      ~17     ~16, !2
         17        FETCH_R                      local               ~18     ~17
         18        FETCH_OBJ_R                                      ~19     !0, ~18
         19        END_SILENCE                                              ~15
         20        ECHO                                                     ~19
         21      > JMP                                                      ->27
   15    22  E > > CATCH                                       last         'Error'
   16    23    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         24        DO_FCALL                                      0  $20     
         25        ECHO                                                     $20
         26        ECHO                                                     '%0A'
   20    27    >   FETCH_DIM_R                                      ~21     !1, !2
         28        FETCH_OBJ_R                                      ~22     !0, ~21
         29        ECHO                                                     ~22
   21    30        FETCH_DIM_R                                      ~23     !1, !2
         31        FETCH_OBJ_R                                      ~24     !0, ~23
         32        CAST                                          6  ~25     ~24
         33        ECHO                                                     ~25
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.34 ms | 1395 KiB | 13 Q