3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = (object)[ "svg" => (array)[ (object)[], (object)[ "linearGradient" => [ (object)[ "@style" => "testing", ], ], ], ], ]; $str = "svg.1.linearGradient.0.@style"; $keys = explode('.', $str); $exp = "\$arr"; $val = $arr; foreach($keys as $index => $key) { $exp .= is_object($val) ? "->{'" . $key . "'}" : "[" . $key . "]"; $val = is_object($val) ? $val->$key : $val[$key]; } eval("unset($exp);");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 41
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 41
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
Branch analysis from position: 37
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/Fdo6B
function name:  (null)
number of ops:  47
compiled vars:  !0 = $arr, !1 = $str, !2 = $keys, !3 = $exp, !4 = $val, !5 = $key, !6 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   CAST                                              8  ~7      <array>
          1        INIT_ARRAY                                           ~8      ~7
          2        CAST                                              8  ~9      <array>
          3        INIT_ARRAY                                           ~10     ~9
          4        INIT_ARRAY                                           ~11     ~10, 'linearGradient'
          5        CAST                                              8  ~12     ~11
          6        ADD_ARRAY_ELEMENT                                    ~8      ~12
          7        CAST                                              7  ~13     ~8
          8        INIT_ARRAY                                           ~14     ~13, 'svg'
          9        CAST                                              8  ~15     ~14
    3    10        ASSIGN                                                       !0, ~15
   16    11        ASSIGN                                                       !1, 'svg.1.linearGradient.0.%40style'
   17    12        INIT_FCALL                                                   'explode'
         13        SEND_VAL                                                     '.'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                             $18     
         16        ASSIGN                                                       !2, $18
   18    17        ASSIGN                                                       !3, '%24arr'
   19    18        ASSIGN                                                       !4, !0
   20    19      > FE_RESET_R                                           $22     !2, ->41
         20    > > FE_FETCH_R                                           ~23     $22, !5, ->41
         21    >   ASSIGN                                                       !6, ~23
   21    22        TYPE_CHECK                                      256          !4
         23      > JMPZ                                                         ~25, ->28
   22    24    >   CONCAT                                               ~26     '-%3E%7B%27', !5
         25        CONCAT                                               ~27     ~26, '%27%7D'
         26        QM_ASSIGN                                            ~28     ~27
         27      > JMP                                                          ->31
   23    28    >   CONCAT                                               ~29     '%5B', !5
         29        CONCAT                                               ~30     ~29, '%5D'
         30        QM_ASSIGN                                            ~28     ~30
         31    >   ASSIGN_OP                                         8          !3, ~28
   25    32        TYPE_CHECK                                      256          !4
         33      > JMPZ                                                         ~32, ->37
         34    >   FETCH_OBJ_R                                          ~33     !4, !5
         35        QM_ASSIGN                                            ~34     ~33
         36      > JMP                                                          ->39
         37    >   FETCH_DIM_R                                          ~35     !4, !5
         38        QM_ASSIGN                                            ~34     ~35
         39    >   ASSIGN                                                       !4, ~34
   20    40      > JMP                                                          ->20
         41    >   FE_FREE                                                      $22
   28    42        ROPE_INIT                                         3  ~38     'unset%28'
         43        ROPE_ADD                                          1  ~38     ~38, !3
         44        ROPE_END                                          2  ~37     ~38, '%29%3B'
         45        INCLUDE_OR_EVAL                                              ~37, EVAL
         46      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
139.77 ms | 2008 KiB | 14 Q