3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ('1' => (object)array( 'id' => 225, 'user_id' => 1, 'name' => 'Blue Quilted Leather Jacket by Minusey - $499' ), '2' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ), '3' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ) ); //print_r(array_column((array)$array, 'id')); $arr_new = array(); $arr_temp_ids = array(); foreach($array as $key=>$arr_obj) { $arr_val = get_object_vars($arr_obj); if(!isset($arr_temp_ids[$arr_val['id']])) { $arr_new[] = $arr_obj; $arr_temp_ids[$arr_val['id']] = true; } } var_dump($arr_new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 25
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/5FSDN
function name:  (null)
number of ops:  31
compiled vars:  !0 = $array, !1 = $arr_new, !2 = $arr_temp_ids, !3 = $arr_obj, !4 = $key, !5 = $arr_val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~6      <array>
          1        INIT_ARRAY                                       ~7      ~6, 1
   10     2        CAST                                          8  ~8      <array>
          3        ADD_ARRAY_ELEMENT                                ~7      ~8, 2
   16     4        CAST                                          8  ~9      <array>
          5        ADD_ARRAY_ELEMENT                                ~7      ~9, 3
    3     6        ASSIGN                                                   !0, ~7
   23     7        ASSIGN                                                   !1, <array>
   24     8        ASSIGN                                                   !2, <array>
   25     9      > FE_RESET_R                                       $13     !0, ->26
         10    > > FE_FETCH_R                                       ~14     $13, !3, ->26
         11    >   ASSIGN                                                   !4, ~14
   27    12        INIT_FCALL                                               'get_object_vars'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $16     
         15        ASSIGN                                                   !5, $16
   28    16        FETCH_DIM_R                                      ~18     !5, 'id'
         17        ISSET_ISEMPTY_DIM_OBJ                         0  ~19     !2, ~18
         18        BOOL_NOT                                         ~20     ~19
         19      > JMPZ                                                     ~20, ->25
   30    20    >   ASSIGN_DIM                                               !1
         21        OP_DATA                                                  !3
   31    22        FETCH_DIM_R                                      ~22     !5, 'id'
         23        ASSIGN_DIM                                               !2, ~22
         24        OP_DATA                                                  <true>
   25    25    > > JMP                                                      ->10
         26    >   FE_FREE                                                  $13
   34    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.88 ms | 1396 KiB | 17 Q