3v4l.org

run code in 300+ PHP versions simultaneously
<?php function includes_from_array($stringArray, $searchInMe){ if(is_array($stringArray)){ foreach($stringArray as $arr){ if(strpos($searchInMe,$arr) !== false){ return true; } } }else{ if(strpos($searchInMe,$stringArray) !== false){ return true; } } return false; } var_dump(includes_from_array('bad','You are a bad boy')); var_dump(includes_from_array('bad','https://badboy.com')); var_dump(includes_from_array(array('bad','dirty'),'You are a bad boy')); var_dump(includes_from_array(array('bad','dirty'),'https://badboy.com')); var_dump(includes_from_array('bad','You are a good boy')); var_dump(includes_from_array('bad','https://goodboy.com')); var_dump(includes_from_array(array('bad','dirty'),'You are a good boy')); var_dump(includes_from_array(array('bad','dirty'),'https://goodboy.com'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Pefn
function name:  (null)
number of ops:  57
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'includes_from_array'
          2        SEND_VAL                                                 'bad'
          3        SEND_VAL                                                 'You+are+a+bad+boy'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   21     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'includes_from_array'
          9        SEND_VAL                                                 'bad'
         10        SEND_VAL                                                 'https%3A%2F%2Fbadboy.com'
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
   22    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'includes_from_array'
         16        SEND_VAL                                                 <array>
         17        SEND_VAL                                                 'You+are+a+bad+boy'
         18        DO_FCALL                                      0  $4      
         19        SEND_VAR                                                 $4
         20        DO_ICALL                                                 
   23    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'includes_from_array'
         23        SEND_VAL                                                 <array>
         24        SEND_VAL                                                 'https%3A%2F%2Fbadboy.com'
         25        DO_FCALL                                      0  $6      
         26        SEND_VAR                                                 $6
         27        DO_ICALL                                                 
   25    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'includes_from_array'
         30        SEND_VAL                                                 'bad'
         31        SEND_VAL                                                 'You+are+a+good+boy'
         32        DO_FCALL                                      0  $8      
         33        SEND_VAR                                                 $8
         34        DO_ICALL                                                 
   26    35        INIT_FCALL                                               'var_dump'
         36        INIT_FCALL                                               'includes_from_array'
         37        SEND_VAL                                                 'bad'
         38        SEND_VAL                                                 'https%3A%2F%2Fgoodboy.com'
         39        DO_FCALL                                      0  $10     
         40        SEND_VAR                                                 $10
         41        DO_ICALL                                                 
   27    42        INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'includes_from_array'
         44        SEND_VAL                                                 <array>
         45        SEND_VAL                                                 'You+are+a+good+boy'
         46        DO_FCALL                                      0  $12     
         47        SEND_VAR                                                 $12
         48        DO_ICALL                                                 
   28    49        INIT_FCALL                                               'var_dump'
         50        INIT_FCALL                                               'includes_from_array'
         51        SEND_VAL                                                 <array>
         52        SEND_VAL                                                 'https%3A%2F%2Fgoodboy.com'
         53        DO_FCALL                                      0  $14     
         54        SEND_VAR                                                 $14
         55        DO_ICALL                                                 
         56      > RETURN                                                   1

Function includes_from_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/3Pefn
function name:  includes_from_array
number of ops:  26
compiled vars:  !0 = $stringArray, !1 = $searchInMe, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~3, ->17
    5     4    > > FE_RESET_R                                       $4      !0, ->15
          5    > > FE_FETCH_R                                               $4, !2, ->15
    6     6    >   INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $5      
         10        TYPE_CHECK                                  1018          $5
         11      > JMPZ                                                     ~6, ->14
    7    12    >   FE_FREE                                                  $4
         13      > RETURN                                                   <true>
    5    14    > > JMP                                                      ->5
         15    >   FE_FREE                                                  $4
         16      > JMP                                                      ->24
   12    17    >   INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $7      
         21        TYPE_CHECK                                  1018          $7
         22      > JMPZ                                                     ~8, ->24
   13    23    > > RETURN                                                   <true>
   16    24    > > RETURN                                                   <false>
   17    25*     > RETURN                                                   null

End of function includes_from_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.55 ms | 1418 KiB | 25 Q