3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['my', 'unique', 'values', 'array', 'and', 'so', 'on']; $result = []; $tot = count($array) - 1; while ($tot > -1) { $temp = $result; $result = []; $result[$array[$tot]] = $temp; $tot--; } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/dUNmU
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $result, !2 = $tot, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        COUNT                                            ~6      !0
          3        SUB                                              ~7      ~6, 1
          4        ASSIGN                                                   !2, ~7
    7     5      > JMP                                                      ->12
    8     6    >   ASSIGN                                                   !3, !1
    9     7        ASSIGN                                                   !1, <array>
   10     8        FETCH_DIM_R                                      ~11     !0, !2
          9        ASSIGN_DIM                                               !1, ~11
         10        OP_DATA                                                  !3
   11    11        PRE_DEC                                                  !2
    7    12    >   IS_SMALLER                                               -1, !2
         13      > JMPNZ                                                    ~14, ->6
   14    14    >   INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.26 ms | 1004 KiB | 14 Q