3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new stdClass(); $obj->name1->name2 = 'value2'; $param2 = 'name1->name2'; $result = $obj; foreach( explode( '->', $param2) as $var) { $result = $result->$var; } echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/iGJBK
function name:  (null)
number of ops:  20
compiled vars:  !0 = $obj, !1 = $param2, !2 = $result, !3 = $var
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        FETCH_OBJ_W                                      $7      !0, 'name1'
          4        ASSIGN_OBJ                                               $7, 'name2'
          5        OP_DATA                                                  'value2'
    5     6        ASSIGN                                                   !1, 'name1-%3Ename2'
    7     7        ASSIGN                                                   !2, !0
    8     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '-%3E'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $11     
         12      > FE_RESET_R                                       $12     $11, ->17
         13    > > FE_FETCH_R                                               $12, !3, ->17
    9    14    >   FETCH_OBJ_R                                      ~13     !2, !3
         15        ASSIGN                                                   !2, ~13
    8    16      > JMP                                                      ->13
         17    >   FE_FREE                                                  $12
   11    18        ECHO                                                     !2
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.21 ms | 1395 KiB | 15 Q