3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = array ( '2021-07-07' => array ( 0 => array ( 'id' => 5435435, 'homeID' => 8754, 'match_url' => '/usa/reading-united-ac-vs-ocean-city-noreasters-fc-h2h-stats#1229873', 'competition_id' => 5808, 'matches_completed_minimum' => 12, ), 1 => array ( 'id' => 1229873, 'homeID' => 8754, 'match_url' => '/usa/reading-united-ac-vs-ocean-city-noreasters-fc-h2h-stats#1229873', 'competition_id' => 5808, 'matches_completed_minimum' => 12, ), ), '2021-07-09' => array ( 0 => array ( 'id' => 3243234, 'homeID' => 8754, 'match_url' => '/usa/reading-united-ac-vs-ocean-city-noreasters-fc-h2h-stats#1229873', 'competition_id' => 5808, 'matches_completed_minimum' => 12, ), 1 => array ( 'id' => 1229873, 'homeID' => 8754, 'match_url' => '/usa/reading-united-ac-vs-ocean-city-noreasters-fc-h2h-stats#1229873', 'competition_id' => 5808, 'matches_completed_minimum' => 12, ), ), ); $seen = []; foreach(array_keys($data) as $i) { foreach(array_keys($data[$i]) as $j) { $id = $data[$i][$j]['id']; if( in_array($id, $seen) ) { unset($data[$i][$j]); } else { $seen[] = $id; } } } var_dump($data, $seen);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 27
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/g78VA
function name:  (null)
number of ops:  33
compiled vars:  !0 = $data, !1 = $seen, !2 = $i, !3 = $j, !4 = $id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   44     1        ASSIGN                                                       !1, <array>
   46     2        INIT_FCALL                                                   'array_keys'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $7      
          5      > FE_RESET_R                                           $8      $7, ->27
          6    > > FE_FETCH_R                                                   $8, !2, ->27
   47     7    >   INIT_FCALL                                                   'array_keys'
          8        FETCH_DIM_R                                          ~9      !0, !2
          9        SEND_VAL                                                     ~9
         10        DO_ICALL                                             $10     
         11      > FE_RESET_R                                           $11     $10, ->25
         12    > > FE_FETCH_R                                                   $11, !3, ->25
   48    13    >   FETCH_DIM_R                                          ~12     !0, !2
         14        FETCH_DIM_R                                          ~13     ~12, !3
         15        FETCH_DIM_R                                          ~14     ~13, 'id'
         16        ASSIGN                                                       !4, ~14
   49    17        FRAMELESS_ICALL_2                in_array            ~16     !4, !1
         18      > JMPZ                                                         ~16, ->22
   50    19    >   FETCH_DIM_UNSET                                      $17     !0, !2
         20        UNSET_DIM                                                    $17, !3
   49    21      > JMP                                                          ->24
   52    22    >   ASSIGN_DIM                                                   !1
         23        OP_DATA                                                      !4
   47    24    > > JMP                                                          ->12
         25    >   FE_FREE                                                      $11
   46    26      > JMP                                                          ->6
         27    >   FE_FREE                                                      $8
   57    28        INIT_FCALL                                                   'var_dump'
         29        SEND_VAR                                                     !0
         30        SEND_VAR                                                     !1
         31        DO_ICALL                                                     
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.46 ms | 1572 KiB | 15 Q