3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $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['id'] ] = $row; } print_r($category_map);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/afcvR
function name:  (null)
number of ops:  18
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                                                 32767
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, <array>
   12     4        ASSIGN                                                   !1, <array>
   13     5      > FE_RESET_R                                       $6      !0, ->13
          6    > > FE_FETCH_R                                               $6, !2, ->13
   14     7    >   FETCH_DIM_R                                      ~7      !2, 'cat'
          8        FETCH_DIM_R                                      ~9      !2, 'id'
          9        FETCH_DIM_W                                      $8      !1, ~7
         10        ASSIGN_DIM                                               $8, ~9
         11        OP_DATA                                                  !2
   13    12      > JMP                                                      ->6
         13    >   FE_FREE                                                  $6
   17    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.22 ms | 1399 KiB | 17 Q