3v4l.org

run code in 300+ PHP versions simultaneously
<?php $A = [3,45,67,8]; $B = [ 1 => [1,6,8], 2 => [5,67,3,4,5,66,6], 3 => [55,56,57,58], 4 => [45,80,81,82] ]; $result = []; foreach ($B as $key => $haystack) { if (array_intersect($B, $A)) { $result[] = $key; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/5rRNf
function name:  (null)
number of ops:  19
compiled vars:  !0 = $A, !1 = $B, !2 = $result, !3 = $haystack, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN                                                   !2, <array>
   10     3      > FE_RESET_R                                       $8      !1, ->14
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->14
          5    >   ASSIGN                                                   !4, ~9
   11     6        INIT_FCALL                                               'array_intersect'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $11     
         10      > JMPZ                                                     $11, ->13
   12    11    >   ASSIGN_DIM                                               !2
         12        OP_DATA                                                  !4
   10    13    > > JMP                                                      ->4
         14    >   FE_FREE                                                  $8
   15    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.77 ms | 1395 KiB | 17 Q