3v4l.org

run code in 300+ PHP versions simultaneously
<?php $entries = array( "111 222 465", "666 123 412", "000 999 222", ); $test = array(111, 465, 555, 666, 777); foreach ($entries as $key => $entry) { $plotsTotal1 = explode(' ', $entry); $plotsTotal2 = array_filter($plotsTotal1); $matches = array_intersect($test, $plotsTotal2); if (count($matches) > 0) { echo 'Entry ' . $key. ' contains ' . implode(',', $matches) . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 32
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 31
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/MPCe9
function name:  (null)
number of ops:  34
compiled vars:  !0 = $entries, !1 = $test, !2 = $entry, !3 = $key, !4 = $plotsTotal1, !5 = $plotsTotal2, !6 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $9      !0, ->32
          3    > > FE_FETCH_R                                       ~10     $9, !2, ->32
          4    >   ASSIGN                                                   !3, ~10
   11     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '+'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $12     
          9        ASSIGN                                                   !4, $12
   12    10        INIT_FCALL                                               'array_filter'
         11        SEND_VAR                                                 !4
         12        DO_ICALL                                         $14     
         13        ASSIGN                                                   !5, $14
   14    14        INIT_FCALL                                               'array_intersect'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !6, $16
   16    19        COUNT                                            ~18     !6
         20        IS_SMALLER                                               0, ~18
         21      > JMPZ                                                     ~19, ->31
   17    22    >   CONCAT                                           ~20     'Entry+', !3
         23        CONCAT                                           ~21     ~20, '+contains+'
         24        INIT_FCALL                                               'implode'
         25        SEND_VAL                                                 '%2C'
         26        SEND_VAR                                                 !6
         27        DO_ICALL                                         $22     
         28        CONCAT                                           ~23     ~21, $22
         29        CONCAT                                           ~24     ~23, '%0A'
         30        ECHO                                                     ~24
   10    31    > > JMP                                                      ->3
         32    >   FE_FREE                                                  $9
   19    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.8 ms | 1396 KiB | 21 Q