3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = [ ['name' => 'Benjoe', 'number' => '001'], ['name' => 'Benjoe', 'number' => '002'], ['name' => 'Benjoe', 'number' => '001'], ]; $temp = []; foreach($results as $index => $log) { $val = $log['name'] . '_' . $log['number']; if (in_array($val, $temp)) { echo "Duplicate found at index {$index}<br/>\n"; } else { $temp[] = $val; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/0ssGC
function name:  (null)
number of ops:  25
compiled vars:  !0 = $results, !1 = $temp, !2 = $log, !3 = $index, !4 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $7      !0, ->23
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->23
          4    >   ASSIGN                                                   !3, ~8
   11     5        FETCH_DIM_R                                      ~10     !2, 'name'
          6        CONCAT                                           ~11     ~10, '_'
          7        FETCH_DIM_R                                      ~12     !2, 'number'
          8        CONCAT                                           ~13     ~11, ~12
          9        ASSIGN                                                   !4, ~13
   12    10        INIT_FCALL                                               'in_array'
         11        SEND_VAR                                                 !4
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $15     
         14      > JMPZ                                                     $15, ->20
   13    15    >   ROPE_INIT                                     3  ~17     'Duplicate+found+at+index+'
         16        ROPE_ADD                                      1  ~17     ~17, !3
         17        ROPE_END                                      2  ~16     ~17, '%3Cbr%2F%3E%0A'
         18        ECHO                                                     ~16
         19      > JMP                                                      ->22
   15    20    >   ASSIGN_DIM                                               !1
         21        OP_DATA                                                  !4
   10    22    > > JMP                                                      ->3
         23    >   FE_FREE                                                  $7
   17    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.37 ms | 1400 KiB | 15 Q