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 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 20
Branch analysis from position: 20
2 jumps found. (Code = 107) Position 1 = 21, Position 2 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J6MqJ
function name:  (null)
number of ops:  33
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        FETCH_CONSTANT                                   ~15     'data'
         15        FETCH_DIM_R                                      ~16     ~15, !2
         16        FETCH_R                      local               ~17     ~16
         17        FETCH_OBJ_R                                      ~18     !0, ~17
         18        ECHO                                                     ~18
         19      > JMP                                                      ->25
   15    20  E > > CATCH                                       last         'Error'
   16    21    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         22        DO_FCALL                                      0  $19     
         23        ECHO                                                     $19
         24        ECHO                                                     '%0A'
   20    25    >   FETCH_DIM_R                                      ~20     !1, !2
         26        FETCH_OBJ_R                                      ~21     !0, ~20
         27        ECHO                                                     ~21
   21    28        FETCH_DIM_R                                      ~22     !1, !2
         29        FETCH_OBJ_R                                      ~23     !0, ~22
         30        CAST                                          6  ~24     ~23
         31        ECHO                                                     ~24
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.53 ms | 1395 KiB | 13 Q