3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array ("apple","banana","papaya","watermelon","avocado"); $array2 = array ("apple","avocado"); $set = []; foreach($array2 as $element){ $set[$element] = true; } $result = []; foreach($array1 as $element){ if(!isset($set[$element])){ $result[] = $element; } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 8
filename:       /in/PcS45
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array1, !1 = $array2, !2 = $set, !3 = $element, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    8     3      > FE_RESET_R                                       $8      !1, ->8
          4    > > FE_FETCH_R                                               $8, !3, ->8
    9     5    >   ASSIGN_DIM                                               !2, !3
          6        OP_DATA                                                  <true>
    8     7      > JMP                                                      ->4
          8    >   FE_FREE                                                  $8
   12     9        ASSIGN                                                   !4, <array>
   15    10      > FE_RESET_R                                       $11     !0, ->18
         11    > > FE_FETCH_R                                               $11, !3, ->18
   16    12    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !2, !3
         13        BOOL_NOT                                         ~13     ~12
         14      > JMPZ                                                     ~13, ->17
   17    15    >   ASSIGN_DIM                                               !4
         16        OP_DATA                                                  !3
   15    17    > > JMP                                                      ->11
         18    >   FE_FREE                                                  $11
   22    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
242.07 ms | 1396 KiB | 16 Q