3v4l.org

run code in 300+ PHP versions simultaneously
<?php $routes = ['foo.bar.index', 'foo.bar.create', 'hello.world.index']; foreach ($routes as $route) { $route = explode('.', $route); $permissions[] = $permissions[$route[0]][$route[1]][$route[2]]; } print_r($permissions);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/iLLk5
function name:  (null)
number of ops:  22
compiled vars:  !0 = $routes, !1 = $route, !2 = $permissions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->17
          2    > > FE_FETCH_R                                               $4, !1, ->17
    7     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '.'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    9     8        FETCH_DIM_R                                      ~8      !1, 0
          9        FETCH_DIM_R                                      ~10     !1, 1
         10        FETCH_DIM_R                                      ~12     !1, 2
         11        FETCH_DIM_R                                      ~9      !2, ~8
         12        FETCH_DIM_R                                      ~11     ~9, ~10
         13        FETCH_DIM_R                                      ~13     ~11, ~12
         14        ASSIGN_DIM                                               !2
         15        OP_DATA                                                  ~13
    5    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $4
   12    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.99 ms | 1395 KiB | 17 Q