3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $db_results = array( array('cat' => 1, 'id' => 1), array('cat' => 1, 'id' => 2), array('cat' => 2, 'id' => 3), array('cat' => 2, 'id' => 4) ); $category_map = array(); foreach ( $db_results as $row ) { $category_map[ $row['cat'] ][] = $row; } print_r($category_map);
Finding entry points
Branch analysis from position: 0
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 = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/iHX9Y
function name:  (null)
number of ops:  17
compiled vars:  !0 = $db_results, !1 = $category_map, !2 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, <array>
   12     4        ASSIGN                                                   !1, <array>
   13     5      > FE_RESET_R                                       $6      !0, ->12
          6    > > FE_FETCH_R                                               $6, !2, ->12
   14     7    >   FETCH_DIM_R                                      ~7      !2, 'cat'
          8        FETCH_DIM_W                                      $8      !1, ~7
          9        ASSIGN_DIM                                               $8
         10        OP_DATA                                                  !2
   13    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $6
   17    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1395 KiB | 17 Q