3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['other'], [['other'], ['value']] ]; $keys = [1, 1]; $result = &$array; $last = array_pop($keys); foreach ($keys as $key) { $result = &$result[$key]; } unset($result[$last]); print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/0a5Nv
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $keys, !2 = $result, !3 = $last, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN_REF                                               !2, !0
   10     3        INIT_FCALL                                               'array_pop'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !3, $8
   12     7      > FE_RESET_R                                       $10     !1, ->12
          8    > > FE_FETCH_R                                               $10, !4, ->12
   13     9    >   FETCH_DIM_W                                      $11     !2, !4
         10        ASSIGN_REF                                               !2, $11
   12    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $10
   16    13        UNSET_DIM                                                !2, !3
   18    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:
145.55 ms | 1399 KiB | 17 Q