3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['user_id' => 82, 'ac_type' => 1], ['user_id' => 80, 'ac_type' => 5], ['user_id' => 76, 'ac_type' => 1], ['user_id' => 82, 'ac_type' => 2], ['user_id' => 80, 'ac_type' => 6] ]; var_export( array_values( array_reduce( $array, fn($res, $row) => array_replace([$row['user_id'] => $row], $res), [] ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vl1UE
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>
   11     1        INIT_FCALL                                               'var_export'
   12     2        INIT_FCALL                                               'array_values'
   13     3        INIT_FCALL                                               'array_reduce'
   14     4        SEND_VAR                                                 !0
   15     5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          6        SEND_VAL                                                 ~2
   16     7        SEND_VAL                                                 <array>
   13     8        DO_ICALL                                         $3      
   16     9        SEND_VAR                                                 $3
   12    10        DO_ICALL                                         $4      
   16    11        SEND_VAR                                                 $4
   11    12        DO_ICALL                                                 
   19    13      > 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/vl1UE
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $res, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'array_replace'
          3        FETCH_DIM_R                                      ~2      !1, 'user_id'
          4        INIT_ARRAY                                       ~3      !1, ~2
          5        SEND_VAL                                                 ~3
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
          9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.96 ms | 1001 KiB | 17 Q