3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_rows = array(); $_sub_categories = array(); for($i = 1; $i <= 28; $i++) { if(in_array($i, array(1,2))) { $_rows['row1'][] = 'Category '.$i; } if(in_array($i, array(3,4,5))) { $_rows['row2'][] = 'Category '.$i; } if(in_array($i, array(6,7,8))) { $_rows['row3'][] = 'Category '.$i; } if(in_array($i, array(9,10,11))) { $_rows['row4'][] = 'Category '.$i; } if(in_array($i, array(12,13))) { $_rows['row5'][] = 'Category '.$i; } if(in_array($i, array(14,15,16))) { $_rows['row6'][] = 'Category '.$i; } if(in_array($i, array(17,18,19))) { $_rows['row7'][] = 'Category '.$i; } if(in_array($i, array(20,21,22))) { $_rows['row8'][] = 'Category '.$i; } if(in_array($i, array(23,24,25))) { $_rows['row9'][] = 'Category '.$i; } if(in_array($i, array(26,27,28))) { $_rows['row10'][] = 'Category '.$i; } } foreach($_rows as $key => $val) { if(in_array($key, array('row1'))) { $_sub_categories[1][] = $val; } if(in_array($key, array('row2','row3','row4'))) { $_sub_categories[2][] = $val; } if(in_array($key, array('row5'))) { $_sub_categories[3][] = $val; } if(in_array($key, array('row6','row7','row8','row9','row10'))) { $_sub_categories[4][] = $val; } } print_r($_sub_categories); foreach($_sub_categories as $_subcats):?> <ul> <?php foreach($_subcats as $_subcat) : ?> <?php $j = 0; ?> <?php foreach($_subcat as $_sub_category): $j++; ?> <li <?php if($j==1) { echo 'class="first"'; } ?>><?php echo $_sub_category; ?></li> <?php endforeach; ?> <?php endforeach; ?> </ul> <?php endforeach; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
2 jumps found. (Code = 44) Position 1 = 97, Position 2 = 4
Branch analysis from position: 97
2 jumps found. (Code = 77) Position 1 = 98, Position 2 = 121
Branch analysis from position: 98
2 jumps found. (Code = 78) Position 1 = 99, Position 2 = 121
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 102, Position 2 = 105
Branch analysis from position: 102
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 110
Branch analysis from position: 107
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 115
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 120
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 98
Branch analysis from position: 98
Branch analysis from position: 120
Branch analysis from position: 115
Branch analysis from position: 110
Branch analysis from position: 105
Branch analysis from position: 121
2 jumps found. (Code = 77) Position 1 = 126, Position 2 = 149
Branch analysis from position: 126
2 jumps found. (Code = 78) Position 1 = 127, Position 2 = 149
Branch analysis from position: 127
2 jumps found. (Code = 77) Position 1 = 129, Position 2 = 146
Branch analysis from position: 129
2 jumps found. (Code = 78) Position 1 = 130, Position 2 = 146
Branch analysis from position: 130
2 jumps found. (Code = 77) Position 1 = 134, Position 2 = 144
Branch analysis from position: 134
2 jumps found. (Code = 78) Position 1 = 135, Position 2 = 144
Branch analysis from position: 135
2 jumps found. (Code = 43) Position 1 = 139, Position 2 = 140
Branch analysis from position: 139
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 140
Branch analysis from position: 144
1 jumps found. (Code = 42) Position 1 = 129
Branch analysis from position: 129
Branch analysis from position: 144
Branch analysis from position: 146
1 jumps found. (Code = 42) Position 1 = 126
Branch analysis from position: 126
Branch analysis from position: 146
Branch analysis from position: 149
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 149
Branch analysis from position: 121
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 49
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 58
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 67
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 76
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 85
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 94
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 97, Position 2 = 4
Branch analysis from position: 97
Branch analysis from position: 4
Branch analysis from position: 94
Branch analysis from position: 85
Branch analysis from position: 76
Branch analysis from position: 67
Branch analysis from position: 58
Branch analysis from position: 49
Branch analysis from position: 40
Branch analysis from position: 31
Branch analysis from position: 22
Branch analysis from position: 13
filename:       /in/T2Gfp
function name:  (null)
number of ops:  151
compiled vars:  !0 = $_rows, !1 = $_sub_categories, !2 = $i, !3 = $val, !4 = $key, !5 = $_subcats, !6 = $_subcat, !7 = $j, !8 = $_sub_category
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->95
    7     4    >   INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $12     
          8      > JMPZ                                                     $12, ->13
    8     9    >   CONCAT                                           ~15     'Category+', !2
         10        FETCH_DIM_W                                      $13     !0, 'row1'
         11        ASSIGN_DIM                                               $13
         12        OP_DATA                                                  ~15
   11    13    >   INIT_FCALL                                               'in_array'
         14        SEND_VAR                                                 !2
         15        SEND_VAL                                                 <array>
         16        DO_ICALL                                         $16     
         17      > JMPZ                                                     $16, ->22
   12    18    >   CONCAT                                           ~19     'Category+', !2
         19        FETCH_DIM_W                                      $17     !0, 'row2'
         20        ASSIGN_DIM                                               $17
         21        OP_DATA                                                  ~19
   15    22    >   INIT_FCALL                                               'in_array'
         23        SEND_VAR                                                 !2
         24        SEND_VAL                                                 <array>
         25        DO_ICALL                                         $20     
         26      > JMPZ                                                     $20, ->31
   16    27    >   CONCAT                                           ~23     'Category+', !2
         28        FETCH_DIM_W                                      $21     !0, 'row3'
         29        ASSIGN_DIM                                               $21
         30        OP_DATA                                                  ~23
   19    31    >   INIT_FCALL                                               'in_array'
         32        SEND_VAR                                                 !2
         33        SEND_VAL                                                 <array>
         34        DO_ICALL                                         $24     
         35      > JMPZ                                                     $24, ->40
   20    36    >   CONCAT                                           ~27     'Category+', !2
         37        FETCH_DIM_W                                      $25     !0, 'row4'
         38        ASSIGN_DIM                                               $25
         39        OP_DATA                                                  ~27
   23    40    >   INIT_FCALL                                               'in_array'
         41        SEND_VAR                                                 !2
         42        SEND_VAL                                                 <array>
         43        DO_ICALL                                         $28     
         44      > JMPZ                                                     $28, ->49
   24    45    >   CONCAT                                           ~31     'Category+', !2
         46        FETCH_DIM_W                                      $29     !0, 'row5'
         47        ASSIGN_DIM                                               $29
         48        OP_DATA                                                  ~31
   27    49    >   INIT_FCALL                                               'in_array'
         50        SEND_VAR                                                 !2
         51        SEND_VAL                                                 <array>
         52        DO_ICALL                                         $32     
         53      > JMPZ                                                     $32, ->58
   28    54    >   CONCAT                                           ~35     'Category+', !2
         55        FETCH_DIM_W                                      $33     !0, 'row6'
         56        ASSIGN_DIM                                               $33
         57        OP_DATA                                                  ~35
   31    58    >   INIT_FCALL                                               'in_array'
         59        SEND_VAR                                                 !2
         60        SEND_VAL                                                 <array>
         61        DO_ICALL                                         $36     
         62      > JMPZ                                                     $36, ->67
   32    63    >   CONCAT                                           ~39     'Category+', !2
         64        FETCH_DIM_W                                      $37     !0, 'row7'
         65        ASSIGN_DIM                                               $37
         66        OP_DATA                                                  ~39
   35    67    >   INIT_FCALL                                               'in_array'
         68        SEND_VAR                                                 !2
         69        SEND_VAL                                                 <array>
         70        DO_ICALL                                         $40     
         71      > JMPZ                                                     $40, ->76
   36    72    >   CONCAT                                           ~43     'Category+', !2
         73        FETCH_DIM_W                                      $41     !0, 'row8'
         74        ASSIGN_DIM                                               $41
         75        OP_DATA                                                  ~43
   39    76    >   INIT_FCALL                                               'in_array'
         77        SEND_VAR                                                 !2
         78        SEND_VAL                                                 <array>
         79        DO_ICALL                                         $44     
         80      > JMPZ                                                     $44, ->85
   40    81    >   CONCAT                                           ~47     'Category+', !2
         82        FETCH_DIM_W                                      $45     !0, 'row9'
         83        ASSIGN_DIM                                               $45
         84        OP_DATA                                                  ~47
   44    85    >   INIT_FCALL                                               'in_array'
         86        SEND_VAR                                                 !2
         87        SEND_VAL                                                 <array>
         88        DO_ICALL                                         $48     
         89      > JMPZ                                                     $48, ->94
   45    90    >   CONCAT                                           ~51     'Category+', !2
         91        FETCH_DIM_W                                      $49     !0, 'row10'
         92        ASSIGN_DIM                                               $49
         93        OP_DATA                                                  ~51
    5    94    >   PRE_INC                                                  !2
         95    >   IS_SMALLER_OR_EQUAL                                      !2, 28
         96      > JMPNZ                                                    ~53, ->4
   51    97    > > FE_RESET_R                                       $54     !0, ->121
         98    > > FE_FETCH_R                                       ~55     $54, !3, ->121
         99    >   ASSIGN                                                   !4, ~55
   52   100        IN_ARRAY                                                 !4, <array>
        101      > JMPZ                                                     ~57, ->105
   53   102    >   FETCH_DIM_W                                      $58     !1, 1
        103        ASSIGN_DIM                                               $58
        104        OP_DATA                                                  !3
   56   105    >   IN_ARRAY                                                 !4, <array>
        106      > JMPZ                                                     ~60, ->110
   57   107    >   FETCH_DIM_W                                      $61     !1, 2
        108        ASSIGN_DIM                                               $61
        109        OP_DATA                                                  !3
   60   110    >   IN_ARRAY                                                 !4, <array>
        111      > JMPZ                                                     ~63, ->115
   61   112    >   FETCH_DIM_W                                      $64     !1, 3
        113        ASSIGN_DIM                                               $64
        114        OP_DATA                                                  !3
   64   115    >   IN_ARRAY                                                 !4, <array>
        116      > JMPZ                                                     ~66, ->120
   65   117    >   FETCH_DIM_W                                      $67     !1, 4
        118        ASSIGN_DIM                                               $67
        119        OP_DATA                                                  !3
   51   120    > > JMP                                                      ->98
        121    >   FE_FREE                                                  $54
   70   122        INIT_FCALL                                               'print_r'
        123        SEND_VAR                                                 !1
        124        DO_ICALL                                                 
   73   125      > FE_RESET_R                                       $70     !1, ->149
        126    > > FE_FETCH_R                                               $70, !5, ->149
   74   127    >   ECHO                                                     '%3Cul%3E%0A'
   75   128      > FE_RESET_R                                       $71     !5, ->146
        129    > > FE_FETCH_R                                               $71, !6, ->146
   76   130    >   ECHO                                                     '%0A++++++++'
   77   131        ASSIGN                                                   !7, 0
   78   132        ECHO                                                     '++++++++'
        133      > FE_RESET_R                                       $73     !6, ->144
        134    > > FE_FETCH_R                                               $73, !8, ->144
        135    >   PRE_INC                                                  !7
   79   136        ECHO                                                     '++++++++%3Cli+'
        137        IS_EQUAL                                                 !7, 1
        138      > JMPZ                                                     ~75, ->140
        139    >   ECHO                                                     'class%3D%22first%22'
        140    >   ECHO                                                     '%3E'
        141        ECHO                                                     !8
        142        ECHO                                                     '%3C%2Fli%3E%0A++++%09'
   78   143      > JMP                                                      ->134
        144    >   FE_FREE                                                  $73
   75   145      > JMP                                                      ->129
        146    >   FE_FREE                                                  $71
   82   147        ECHO                                                     '%3C%2Ful%3E%0A'
   73   148      > JMP                                                      ->126
        149    >   FE_FREE                                                  $70
   83   150      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.03 ms | 1412 KiB | 17 Q