3v4l.org

run code in 500+ PHP versions simultaneously
<?php $forbidden_words = array("word1", "word2", "word3"); $string = "a very long text .... word"; if(preg_match('/\b(' . implode('|', array_map('preg_quote', $forbidden_words)) . ')\b/', $string)) { echo 'have forbidden word(s)'; } else { echo 'no forbidden words'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y4gTJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $forbidden_words, !1 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, 'a+very+long+text+....+word'
    4     2        INIT_FCALL                                                   'array_map'
          3        SEND_VAL                                                     'preg_quote'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $4      
          6        FRAMELESS_ICALL_2                implode             ~5      '%7C', $4
          7        CONCAT                                               ~6      '%2F%5Cb%28', ~5
          8        CONCAT                                               ~7      ~6, '%29%5Cb%2F'
          9        FRAMELESS_ICALL_2                preg_match          ~8      ~7, !1
         10      > JMPZ                                                         ~8, ->13
    5    11    >   ECHO                                                         'have+forbidden+word%28s%29'
    4    12      > JMP                                                          ->14
    7    13    >   ECHO                                                         'no+forbidden+words'
    8    14    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.72 ms | 1756 KiB | 14 Q