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); foreach($arr as $key => &$val) { if(!in_array($val['Productname'],$arr)) { var_dump(array_intersect($val, $newArray)); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/cb0jv
function name:  (null)
number of ops:  27
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      > FE_RESET_RW                                      $9      !0, ->25
          8    > > FE_FETCH_RW                                      ~10     $9, !3, ->25
          9    >   ASSIGN                                                   !4, ~10
   13    10        INIT_FCALL                                               'in_array'
         11        FETCH_DIM_R                                      ~12     !3, 'Productname'
         12        SEND_VAL                                                 ~12
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $13     
         15        BOOL_NOT                                         ~14     $13
         16      > JMPZ                                                     ~14, ->24
   14    17    >   INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'array_intersect'
         19        SEND_VAR                                                 !3
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $15     
         22        SEND_VAR                                                 $15
         23        DO_ICALL                                                 
   12    24    > > JMP                                                      ->8
         25    >   FE_FREE                                                  $9
   16    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.55 ms | 1396 KiB | 21 Q