3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.02 ms | 1400 KiB | 15 Q