3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test2'), array('status'=>'OK','Productname'=>'test2') ); $notToDuplicate = array('test2'); $newArray = array_unique($arr, SORT_REGULAR); print_r($newArray); foreach($arr as $key => &$val) { if(!in_array($val['Productname'],$arr)) { print_r(array_intersect($newArray, $val)); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
2 jumps found. (Code = 126) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/WiGnn
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $notToDuplicate, !2 = $newArray, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'array_unique'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   12     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   13    10      > FE_RESET_RW                                      $10     !0, ->28
         11    > > FE_FETCH_RW                                      ~11     $10, !3, ->28
         12    >   ASSIGN                                                   !4, ~11
   14    13        INIT_FCALL                                               'in_array'
         14        FETCH_DIM_R                                      ~13     !3, 'Productname'
         15        SEND_VAL                                                 ~13
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $14     
         18        BOOL_NOT                                         ~15     $14
         19      > JMPZ                                                     ~15, ->27
   15    20    >   INIT_FCALL                                               'print_r'
         21        INIT_FCALL                                               'array_intersect'
         22        SEND_VAR                                                 !2
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $16     
         25        SEND_VAR                                                 $16
         26        DO_ICALL                                                 
   13    27    > > JMP                                                      ->11
         28    >   FE_FREE                                                  $10
   17    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.67 ms | 1396 KiB | 21 Q