3v4l.org

run code in 500+ 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 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/3Pefn
function name:  includes_from_array
number of ops:  20
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, ->14
    5     4    > > FE_RESET_R                                           $4      !0, ->12
          5    > > FE_FETCH_R                                                   $4, !2, ->12
    6     6    >   FRAMELESS_ICALL_2                strpos              ~5      !1, !2
          7        TYPE_CHECK                                      1018          ~5
          8      > JMPZ                                                         ~6, ->11
    7     9    >   FE_FREE                                                      $4
         10      > RETURN                                                       <true>
    5    11    > > JMP                                                          ->5
         12    >   FE_FREE                                                      $4
    4    13      > JMP                                                          ->18
   12    14    >   FRAMELESS_ICALL_2                strpos              ~7      !1, !0
         15        TYPE_CHECK                                      1018          ~7
         16      > JMPZ                                                         ~8, ->18
   13    17    > > RETURN                                                       <true>
   16    18    > > RETURN                                                       <false>
   17    19*     > RETURN                                                       null

End of function includes_from_array

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
176.38 ms | 2019 KiB | 22 Q