3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array =[ 0 => [ 0 => "AUA3H147", 1 => 2015, 2 => 'Audi' ], 1 => [ 0 => "AUA3H147", 1 => 2015, 2 => 'Ford' ], 2 => [ 0 => "AUA3H148", 1 => 2016, 2 => 'Chevy' ], 3 => [ 0 => "AUA3H148", 1 => 2017, 2 => 'Buick' ] ]; foreach ($array as $a) { $compositeKey = $a[0] . '_' . $a[1]; $result[$compositeKey] ??= $a; // only store if first occurrence of compositeKey } var_export(array_values($result)); // re-index and print
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/N8mAj
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $a, !2 = $compositeKey, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   26     1      > FE_RESET_R                                       $5      !0, ->15
          2    > > FE_FETCH_R                                               $5, !1, ->15
   27     3    >   FETCH_DIM_R                                      ~6      !1, 0
          4        CONCAT                                           ~7      ~6, '_'
          5        FETCH_DIM_R                                      ~8      !1, 1
          6        CONCAT                                           ~9      ~7, ~8
          7        ASSIGN                                                   !2, ~9
   28     8        FETCH_DIM_IS                                     ~11     !3, !2
          9        COALESCE                                         ~12     ~11
         10        ASSIGN_DIM                                       ~13     !3, !2
         11        OP_DATA                                                  !1
         12        QM_ASSIGN                                        ~12     ~13
         13        FREE                                                     ~12
   26    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $5
   30    16        INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'array_values'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.74 ms | 1011 KiB | 15 Q