3v4l.org

run code in 300+ PHP versions simultaneously
<?php const ID_INDEX = 0; const NAME_INDEX = 1; $sections = array(array(1, 'Section 1'), array(2, 'Section B'), array(3, 'Just section')); $rubriques = array(array(1, 'Rubiq'), array(2, 'Rubrique'), array(3, 'Ruby')); $categories = array(array(1, 'Category A'), array(2, 'Category B'), array(3, 'Category C')); $output = array(); foreach($sections as $section) { $output[$section[NAME_INDEX]] = array($section[ID_INDEX]); foreach($rubriques as $rubrique) { $output[$section[NAME_INDEX]][$rubrique[NAME_INDEX]] = array($rubrique[ID_INDEX]); foreach($categories as $category) { $output[$section[NAME_INDEX]][$rubrique[NAME_INDEX]][$category[NAME_INDEX]][] = $category[ID_INDEX]; } } } var_dump($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 47
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 47
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 45
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 45
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 43
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 43
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 45
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/ou6rb
function name:  (null)
number of ops:  52
compiled vars:  !0 = $sections, !1 = $rubriques, !2 = $categories, !3 = $output, !4 = $section, !5 = $rubrique, !6 = $category
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CONST                                            'ID_INDEX', 0
    3     1        DECLARE_CONST                                            'NAME_INDEX', 1
    5     2        ASSIGN                                                   !0, <array>
    6     3        ASSIGN                                                   !1, <array>
    7     4        ASSIGN                                                   !2, <array>
    9     5        ASSIGN                                                   !3, <array>
   11     6      > FE_RESET_R                                       $11     !0, ->47
          7    > > FE_FETCH_R                                               $11, !4, ->47
   12     8    >   FETCH_CONSTANT                                   ~12     'NAME_INDEX'
          9        FETCH_DIM_R                                      ~13     !4, ~12
         10        FETCH_CONSTANT                                   ~15     'ID_INDEX'
         11        FETCH_DIM_R                                      ~16     !4, ~15
         12        INIT_ARRAY                                       ~17     ~16
         13        ASSIGN_DIM                                               !3, ~13
         14        OP_DATA                                                  ~17
   14    15      > FE_RESET_R                                       $18     !1, ->45
         16    > > FE_FETCH_R                                               $18, !5, ->45
   15    17    >   FETCH_CONSTANT                                   ~19     'NAME_INDEX'
         18        FETCH_DIM_R                                      ~20     !4, ~19
         19        FETCH_CONSTANT                                   ~22     'NAME_INDEX'
         20        FETCH_DIM_R                                      ~23     !5, ~22
         21        FETCH_CONSTANT                                   ~25     'ID_INDEX'
         22        FETCH_DIM_R                                      ~26     !5, ~25
         23        INIT_ARRAY                                       ~27     ~26
         24        FETCH_DIM_W                                      $21     !3, ~20
         25        ASSIGN_DIM                                               $21, ~23
         26        OP_DATA                                                  ~27
   17    27      > FE_RESET_R                                       $28     !2, ->43
         28    > > FE_FETCH_R                                               $28, !6, ->43
   18    29    >   FETCH_CONSTANT                                   ~29     'NAME_INDEX'
         30        FETCH_DIM_R                                      ~30     !4, ~29
         31        FETCH_CONSTANT                                   ~32     'NAME_INDEX'
         32        FETCH_DIM_R                                      ~33     !5, ~32
         33        FETCH_CONSTANT                                   ~35     'NAME_INDEX'
         34        FETCH_DIM_R                                      ~36     !6, ~35
         35        FETCH_CONSTANT                                   ~39     'ID_INDEX'
         36        FETCH_DIM_R                                      ~40     !6, ~39
         37        FETCH_DIM_W                                      $31     !3, ~30
         38        FETCH_DIM_W                                      $34     $31, ~33
         39        FETCH_DIM_W                                      $37     $34, ~36
         40        ASSIGN_DIM                                               $37
         41        OP_DATA                                                  ~40
   17    42      > JMP                                                      ->28
         43    >   FE_FREE                                                  $28
   14    44      > JMP                                                      ->16
         45    >   FE_FREE                                                  $18
   11    46      > JMP                                                      ->7
         47    >   FE_FREE                                                  $11
   23    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !3
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.26 ms | 1405 KiB | 15 Q