3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nested_array = array(); $temp = &$nested_array; $item = 'brachA-branchB-branchC'; foreach (explode('-', $item) as $key => $value) { $temp = &$temp[$value]; } print_r($nested_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/A781D
function name:  (null)
number of ops:  18
compiled vars:  !0 = $nested_array, !1 = $temp, !2 = $item, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_REF                                               !1, !0
    4     2        ASSIGN                                                   !2, 'brachA-branchB-branchC'
    6     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '-'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $8      
          7      > FE_RESET_R                                       $9      $8, ->13
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->13
          9    >   ASSIGN                                                   !4, ~10
    7    10        FETCH_DIM_W                                      $12     !1, !3
         11        ASSIGN_REF                                               !1, $12
    6    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $9
   10    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.93 ms | 1395 KiB | 17 Q