3v4l.org

run code in 300+ PHP versions simultaneously
<?php $entries = array( array("exoutdoorspaceplottotals" => "111 222 465"), array("exoutdoorspaceplottotals" => "666 123 412"), array("exoutdoorspaceplottotals" => "000 999"), ); $test = array(111, 465, 555, 666, 777); $counter = 0; while ($row = array_shift($entries)) { $plotsTotal1 = explode(' ', $row['exoutdoorspaceplottotals']); $plotsTotal2 = array_filter($plotsTotal1); $matches = array_intersect($test, $plotsTotal2); if (count($matches) > 0) { echo 'Entry ' . $counter++ . ' contains ' . implode(',', $matches) . "\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 4
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 32
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 4
Branch analysis from position: 37
Branch analysis from position: 4
Branch analysis from position: 32
filename:       /in/7qegT
function name:  (null)
number of ops:  38
compiled vars:  !0 = $entries, !1 = $test, !2 = $counter, !3 = $plotsTotal1, !4 = $row, !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        ASSIGN                                                   !2, 0
   12     3      > JMP                                                      ->32
   13     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        FETCH_DIM_R                                      ~10     !4, 'exoutdoorspaceplottotals'
          7        SEND_VAL                                                 ~10
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !3, $11
   14    10        INIT_FCALL                                               'array_filter'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !5, $13
   16    14        INIT_FCALL                                               'array_intersect'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !6, $15
   18    19        COUNT                                            ~17     !6
         20        IS_SMALLER                                               0, ~17
         21      > JMPZ                                                     ~18, ->32
   19    22    >   POST_INC                                         ~19     !2
         23        CONCAT                                           ~20     'Entry+', ~19
         24        CONCAT                                           ~21     ~20, '+contains+'
         25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAR                                                 !6
         28        DO_ICALL                                         $22     
         29        CONCAT                                           ~23     ~21, $22
         30        CONCAT                                           ~24     ~23, '%0A'
         31        ECHO                                                     ~24
   12    32    >   INIT_FCALL                                               'array_shift'
         33        SEND_REF                                                 !0
         34        DO_ICALL                                         $25     
         35        ASSIGN                                           ~26     !4, $25
         36      > JMPNZ                                                    ~26, ->4
   21    37    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.65 ms | 1400 KiB | 23 Q