3v4l.org

run code in 300+ PHP versions simultaneously
<?php $words = array("simple", "123", "aa99"); $sentences = array("this-is-simple-simple-sentence-123-aa99-311qwerty", "this-is-simple-sentence-123", "simple", "foobar"); foreach ($words as $word) { $sentences_found = array_values(array_filter($sentences, function($find_words) use ($word) {return strpos($find_words, $word);})); } print_r($sentences_found);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/b2AoN
function name:  (null)
number of ops:  20
compiled vars:  !0 = $words, !1 = $sentences, !2 = $word, !3 = $sentences_found
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
    7     4    >   INIT_FCALL                                               'array_values'
          5        INIT_FCALL                                               'array_filter'
          6        SEND_VAR                                                 !1
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fb2AoN%3A7%240'
          8        BIND_LEXICAL                                             ~7, !2
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
    6    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   10    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fb2AoN%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b2AoN
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $find_words, !1 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fb2AoN%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.58 ms | 1401 KiB | 21 Q