3v4l.org

run code in 300+ 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 = 30
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 30
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
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 = 12
Branch analysis from position: 12
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/g78VA
function name:  (null)
number of ops:  36
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, ->30
          6    > > FE_FETCH_R                                               $8, !2, ->30
   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, ->28
         12    > > FE_FETCH_R                                               $11, !3, ->28
   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        INIT_FCALL                                               'in_array'
         18        SEND_VAR                                                 !4
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $16     
         21      > JMPZ                                                     $16, ->25
   50    22    >   FETCH_DIM_UNSET                                  $17     !0, !2
         23        UNSET_DIM                                                $17, !3
   49    24      > JMP                                                      ->27
   52    25    >   ASSIGN_DIM                                               !1
         26        OP_DATA                                                  !4
   47    27    > > JMP                                                      ->12
         28    >   FE_FREE                                                  $11
   46    29      > JMP                                                      ->6
         30    >   FE_FREE                                                  $8
   57    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !0
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.77 ms | 1012 KiB | 16 Q