3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cars = [ [ 'icon' => 'sim', 'example' => 'also_duplicate', ], [ 'icon' => 'airtime', 'example' => 'also_duplicate', ], [ 'icon' => 'sim', 'example' => 'also_duplicate', ], ]; echo json_encode(array_intersect_key($cars, array_unique(array_column($cars, 'icon'))));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QkJXn
function name:  (null)
number of ops:  17
compiled vars:  !0 = $cars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'json_encode'
          2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_unique'
          5        INIT_FCALL                                               'array_column'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'icon'
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15        ECHO                                                     $5
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.53 ms | 1000 KiB | 17 Q