3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 0 => [ "id" => 76, "id_sender" => 1, "id_receiver" => 2, "message" => "2 Miliar", "is_read" => 0, "created_at" => "2022-11-28T13:57:17.000000Z", "updated_at" => "2022-11-28T13:57:17.000000Z" ], 1 => [ "id" => 75, "id_sender" => 1, "id_receiver" => 3, "message" => "1 Miliar", "is_read" => 0, "created_at" => "2022-11-28T13:57:10.000000Z", "updated_at" => "2022-11-28T13:57:10.000000Z" ], 2 => [ "id" => 74, "id_sender" => 3, "id_receiver" => 1, "message" => "Property ini berapa harganya?", "is_read" => 1, "created_at" => "2022-11-28T13:52:57.000000Z", "updated_at" => "2022-11-28T13:55:37.000000Z" ], 3 => [ "id" => 73, "id_sender" => 2, "id_receiver" => 1, "message" => "Untuk yang ini berapa harganya?", "is_read" => 1, "created_at" => "2022-11-28T13:07:34.000000Z", "updated_at" => "2022-11-28T13:55:33.000000Z" ] ]; var_export( array_values( array_reduce( $array, function($result, $row) { $ids = [$row['id_sender'], $row['id_receiver']]; sort($ids); $result[implode(',', $ids)] ??= $row; return $result; } ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/saQYk
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   42     1        INIT_FCALL                                                   'var_export'
   43     2        INIT_FCALL                                                   'array_values'
   44     3        INIT_FCALL                                                   'array_reduce'
   45     4        SEND_VAR                                                     !0
   46     5        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   51     6        SEND_VAL                                                     ~2
   44     7        DO_ICALL                                             $3      
   51     8        SEND_VAR                                                     $3
   43     9        DO_ICALL                                             $4      
   51    10        SEND_VAR                                                     $4
   42    11        DO_ICALL                                                     
   54    12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/saQYk
function name:  {closure:/in/saQYk:46}
number of ops:  22
compiled vars:  !0 = $result, !1 = $row, !2 = $ids
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   46     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   47     2        FETCH_DIM_R                                          ~3      !1, 'id_sender'
          3        INIT_ARRAY                                           ~4      ~3
          4        FETCH_DIM_R                                          ~5      !1, 'id_receiver'
          5        ADD_ARRAY_ELEMENT                                    ~4      ~5
          6        ASSIGN                                                       !2, ~4
   48     7        INIT_FCALL                                                   'sort'
          8        SEND_REF                                                     !2
          9        DO_ICALL                                                     
   49    10        FRAMELESS_ICALL_2                implode             ~8      '%2C', !2
         11        COPY_TMP                                             ~9      ~8
         12        FETCH_DIM_IS                                         ~10     !0, ~8
         13        COALESCE                                             ~11     ~10
         14        ASSIGN_DIM                                           ~12     !0, ~9
         15        OP_DATA                                                      !1
         16        QM_ASSIGN                                            ~11     ~12
         17      > JMP                                                          ->19
         18*       FREE                                                         ~9
         19    >   FREE                                                         ~11
   50    20      > RETURN                                                       !0
   51    21*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.39 ms | 1828 KiB | 17 Q