3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 0 => array ( 'company_id' => 1, 'company_abbrev' => 'amd', 'description' => 'amd blah blah blah 1', ), 1 => array ( 'company_id' => 1, 'company_abbrev' => 'amd', 'description' => 'amd blah blah blah 2', ), 2 => array ( 'company_id' => 2, 'company_abbrev' => 'int', 'description' => 'int blah blah 1', ), 3 => array ( 'company_id' => 2, 'company_abbrev' => 'int', 'description' => 'int blah blah 2', ), ); $result = []; foreach ($array as $row) { extract($row); $result[$company_abbrev]['company_id'] = $company_id; $result[$company_abbrev]['job_descriptions'][] = $description; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/pVhQk
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $result, !2 = $row, !3 = $company_abbrev, !4 = $company_id, !5 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   30     1        ASSIGN                                                   !1, <array>
   31     2      > FE_RESET_R                                       $8      !0, ->15
          3    > > FE_FETCH_R                                               $8, !2, ->15
   32     4    >   INIT_FCALL                                               'extract'
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   33     7        FETCH_DIM_W                                      $10     !1, !3
          8        ASSIGN_DIM                                               $10, 'company_id'
          9        OP_DATA                                                  !4
   34    10        FETCH_DIM_W                                      $12     !1, !3
         11        FETCH_DIM_W                                      $13     $12, 'job_descriptions'
         12        ASSIGN_DIM                                               $13
         13        OP_DATA                                                  !5
   31    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $8
   36    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.32 ms | 998 KiB | 15 Q