3v4l.org

run code in 300+ PHP versions simultaneously
<?php $articles = [ [ "id" => 0, "title" => "lorem", "reference" => "A" ], [ "id" => 1, "title" => "ipsum", "reference" => "B" ], [ "id" => 2, "title" => "dolor", "reference" => "C" ], [ "id" => 3, "title" => "sit", "reference" => "A" ] ]; $found = []; foreach ($articles as $index => ['reference' => $ref]) { if (!isset($found[$ref])) { $found[$ref] = $index; } else { unset($articles[$index], $articles[$found[$ref]]); } } var_export($articles);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/cRU6e
function name:  (null)
number of ops:  23
compiled vars:  !0 = $articles, !1 = $found, !2 = $ref, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   26     1        ASSIGN                                                   !1, <array>
   27     2      > FE_RESET_R                                       $6      !0, ->18
          3    > > FE_FETCH_R                                       ~10     $6, $7, ->18
          4    >   FETCH_LIST_R                                     $8      $7, 'reference'
          5        ASSIGN                                                   !2, $8
          6        FREE                                                     $7
          7        ASSIGN                                                   !3, ~10
   28     8        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !1, !2
          9        BOOL_NOT                                         ~13     ~12
         10      > JMPZ                                                     ~13, ->14
   29    11    >   ASSIGN_DIM                                               !1, !2
         12        OP_DATA                                                  !3
         13      > JMP                                                      ->17
   31    14    >   UNSET_DIM                                                !0, !3
         15        FETCH_DIM_R                                      ~15     !1, !2
         16        UNSET_DIM                                                !0, ~15
   27    17    > > JMP                                                      ->3
         18    >   FE_FREE                                                  $6
   34    19        INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.29 ms | 1395 KiB | 15 Q