3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], ]; function flip_row_col_array($array) { $out = array(); foreach ($array as $rowkey => $row) { foreach($row as $colkey => $col){ $out[$colkey][$rowkey]=$col; } } return $out; } var_export(flip_row_col_array($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAm2f
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   20     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'flip_row_col_array'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function flip_row_col_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/SAm2f
function name:  flip_row_col_array
number of ops:  17
compiled vars:  !0 = $array, !1 = $out, !2 = $row, !3 = $rowkey, !4 = $col, !5 = $colkey
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        ASSIGN                                                       !1, <array>
   12     2      > FE_RESET_R                                           $7      !0, ->14
          3    > > FE_FETCH_R                                           ~8      $7, !2, ->14
          4    >   ASSIGN                                                       !3, ~8
   13     5      > FE_RESET_R                                           $10     !2, ->12
          6    > > FE_FETCH_R                                           ~11     $10, !4, ->12
          7    >   ASSIGN                                                       !5, ~11
   14     8        FETCH_DIM_W                                          $13     !1, !5
          9        ASSIGN_DIM                                                   $13, !3
         10        OP_DATA                                                      !4
   13    11      > JMP                                                          ->6
         12    >   FE_FREE                                                      $10
   12    13      > JMP                                                          ->3
         14    >   FE_FREE                                                      $7
   17    15      > RETURN                                                       !1
   18    16*     > RETURN                                                       null

End of function flip_row_col_array

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
175.17 ms | 2052 KiB | 15 Q