3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = ["first", "second", "third"]; $array = []; foreach(array_reverse($keys) as $key) { $temp = $array; unset($array[key($array)]); $array[$key] = $temp; } $array['first']['second']['third'] = 'value'; print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/XPaaG
function name:  (null)
number of ops:  24
compiled vars:  !0 = $keys, !1 = $array, !2 = $key, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_reverse'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5      > FE_RESET_R                                       $7      $6, ->15
          6    > > FE_FETCH_R                                               $7, !2, ->15
    8     7    >   ASSIGN                                                   !3, !1
    9     8        INIT_FCALL                                               'key'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $9      
         11        UNSET_DIM                                                !1, $9
   10    12        ASSIGN_DIM                                               !1, !2
         13        OP_DATA                                                  !3
    7    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $7
   13    16        FETCH_DIM_W                                      $11     !1, 'first'
         17        FETCH_DIM_W                                      $12     $11, 'second'
         18        ASSIGN_DIM                                               $12, 'third'
         19        OP_DATA                                                  'value'
   14    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
285.23 ms | 1395 KiB | 20 Q