3v4l.org

run code in 500+ PHP versions simultaneously
<?php $original = array( array('fruit' => 'appel','color' => 'green'), array('fruit' => 'Banana','color' => 'Yellow'), array('fruit' => 'orange','color' => 'orange',) ); $new = array( array('fruit' => 'appel'), array('fruit' => 'orange') ); $arr = array(); $com = array_column($new, 'fruit'); foreach($original as $value){ if(!in_array($value['fruit'], $com)){ $arr[] = $value; } } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/XJfJ5
function name:  (null)
number of ops:  22
compiled vars:  !0 = $original, !1 = $new, !2 = $arr, !3 = $com, !4 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   14     2        ASSIGN                                                       !2, <array>
   15     3        INIT_FCALL                                                   'array_column'
          4        SEND_VAR                                                     !1
          5        SEND_VAL                                                     'fruit'
          6        DO_ICALL                                             $8      
          7        ASSIGN                                                       !3, $8
   16     8      > FE_RESET_R                                           $10     !0, ->17
          9    > > FE_FETCH_R                                                   $10, !4, ->17
   17    10    >   FETCH_DIM_R                                          ~11     !4, 'fruit'
         11        FRAMELESS_ICALL_2                in_array            ~12     ~11, !3
         12        BOOL_NOT                                             ~13     ~12
         13      > JMPZ                                                         ~13, ->16
   18    14    >   ASSIGN_DIM                                                   !2
         15        OP_DATA                                                      !4
   16    16    > > JMP                                                          ->9
         17    >   FE_FREE                                                      $10
   22    18        INIT_FCALL                                                   'print_r'
         19        SEND_VAR                                                     !2
         20        DO_ICALL                                                     
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.85 ms | 2811 KiB | 15 Q