3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ['type' => 'AAA', 'label_id' => 'A1,35'], ['type' => 'AAA', 'label_id' => 'A2,34'], ['type' => 'BBB', 'label_id' => 'B1,29'], ['type' => 'CCC', 'label_id' => 'C1,20'], ['type' => 'CCC', 'label_id' => 'C2,19'], ['type' => 'CCC', 'label_id' => 'C3,18'] ]; var_export( array_values( array_reduce( $array, function($result, $row) { $result[$row['type']]['type'] ??= $row['type']; $result[$row['type']]['label_id'][] = $row['label_id']; return $result; }, [] ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1m1g7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        INIT_FCALL                                                   'var_export'
   13     2        INIT_FCALL                                                   'array_values'
   14     3        INIT_FCALL                                                   'array_reduce'
   15     4        SEND_VAR                                                     !0
   16     5        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   20     6        SEND_VAL                                                     ~2
   21     7        SEND_VAL                                                     <array>
   14     8        DO_ICALL                                             $3      
   21     9        SEND_VAR                                                     $3
   13    10        DO_ICALL                                             $4      
   21    11        SEND_VAR                                                     $4
   12    12        DO_ICALL                                                     
   24    13      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1m1g7
function name:  {closure:/in/1m1g7:16}
number of ops:  23
compiled vars:  !0 = $result, !1 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   17     2        FETCH_DIM_R                                          ~2      !1, 'type'
          3        COPY_TMP                                             ~3      ~2
          4        FETCH_DIM_IS                                         ~4      !0, ~2
          5        FETCH_DIM_IS                                         ~5      ~4, 'type'
          6        COALESCE                                             ~6      ~5
          7        FETCH_DIM_R                                          ~7      !1, 'type'
          8        FETCH_DIM_W                                          $8      !0, ~3
          9        ASSIGN_DIM                                           ~9      $8, 'type'
         10        OP_DATA                                                      ~7
         11        QM_ASSIGN                                            ~6      ~9
         12      > JMP                                                          ->14
         13*       FREE                                                         ~3
         14    >   FREE                                                         ~6
   18    15        FETCH_DIM_R                                          ~10     !1, 'type'
         16        FETCH_DIM_R                                          ~14     !1, 'label_id'
         17        FETCH_DIM_W                                          $11     !0, ~10
         18        FETCH_DIM_W                                          $12     $11, 'label_id'
         19        ASSIGN_DIM                                                   $12
         20        OP_DATA                                                      ~14
   19    21      > RETURN                                                       !0
   20    22*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.14 ms | 1969 KiB | 16 Q