3v4l.org

run code in 300+ PHP versions simultaneously
<?php $toSort = array( 1 => [ 'value' => 8000, 'key' => 1007 ], 2 => [ 'value' => 8001, 'key' => 1007 ], 3 => [ 'value' => 8002, 'key' => 1013 ], ); var_export( array_reduce( $toSort, function($result, $row) { $result[$row['key']][] = $row['value']; return $result; }, [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6Fah
function name:  (null)
number of ops:  11
compiled vars:  !0 = $toSort
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'var_export'
   22     2        INIT_FCALL                                               'array_reduce'
   23     3        SEND_VAR                                                 !0
   24     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   27     5        SEND_VAL                                                 ~2
   28     6        SEND_VAL                                                 <array>
   22     7        DO_ICALL                                         $3      
   28     8        SEND_VAR                                                 $3
   21     9        DO_ICALL                                                 
   30    10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6Fah
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $result, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        FETCH_DIM_R                                      ~2      !1, 'key'
          3        FETCH_DIM_R                                      ~5      !1, 'value'
          4        FETCH_DIM_W                                      $3      !0, ~2
          5        ASSIGN_DIM                                               $3
          6        OP_DATA                                                  ~5
   26     7      > RETURN                                                   !0
   27     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.82 ms | 1000 KiB | 15 Q