3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], ]; $output = array(); $intern = array(); for($row=0; $row < 4; $row++) for($col=0;$col < 3;$col++) $intern[] = $input[$row][$col]; // nesting the array $count = 0; $subcount = 0; foreach($intern as $value) { $output[$count][$subcount] = $value; $count++; if($subcount == 3) { break; } if($count == 4) { $count = 0; $subcount++; } } var_export($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 33
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 32
Branch analysis from position: 33
Branch analysis from position: 33
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/GYinn
function name:  (null)
number of ops:  38
compiled vars:  !0 = $input, !1 = $output, !2 = $intern, !3 = $row, !4 = $col, !5 = $count, !6 = $subcount, !7 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2        ASSIGN                                                   !2, <array>
   13     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->15
   14     5    >   ASSIGN                                                   !4, 0
          6      > JMP                                                      ->12
   15     7    >   FETCH_DIM_R                                      ~14     !0, !3
          8        FETCH_DIM_R                                      ~15     ~14, !4
          9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  ~15
   14    11        PRE_INC                                                  !4
         12    >   IS_SMALLER                                               !4, 3
         13      > JMPNZ                                                    ~17, ->7
   13    14    >   PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, 4
         16      > JMPNZ                                                    ~19, ->5
   18    17    >   ASSIGN                                                   !5, 0
   19    18        ASSIGN                                                   !6, 0
   21    19      > FE_RESET_R                                       $22     !2, ->33
         20    > > FE_FETCH_R                                               $22, !7, ->33
   24    21    >   FETCH_DIM_W                                      $23     !1, !5
         22        ASSIGN_DIM                                               $23, !6
         23        OP_DATA                                                  !7
   25    24        PRE_INC                                                  !5
   27    25        IS_EQUAL                                                 !6, 3
         26      > JMPZ                                                     ~26, ->28
   29    27    > > JMP                                                      ->33
   32    28    >   IS_EQUAL                                                 !5, 4
         29      > JMPZ                                                     ~27, ->32
   34    30    >   ASSIGN                                                   !5, 0
   35    31        PRE_INC                                                  !6
   21    32    > > JMP                                                      ->20
         33    >   FE_FREE                                                  $22
   41    34        INIT_FCALL                                               'var_export'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.99 ms | 1010 KiB | 14 Q