3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filterwords(string $text, array $bannedWords) { return preg_replace( '/(?=\b(?:' . implode('|', $bannedWords) . ')\b)\w|\G(?!^)\w/i', '*', $text ); } echo filterwords("I am a dummy, but I'm not dumb", ['dummy']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OGKYj
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'filterwords'
          1        SEND_VAL                                                 'I+am+a+dummy%2C+but+I%27m+not+dumb'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function filterwords:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OGKYj
function name:  filterwords
number of ops:  15
compiled vars:  !0 = $text, !1 = $bannedWords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'preg_replace'
    6     3        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%7C'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $2      
          7        CONCAT                                           ~3      '%2F%28%3F%3D%5Cb%28%3F%3A', $2
          8        CONCAT                                           ~4      ~3, '%29%5Cb%29%5Cw%7C%5CG%28%3F%21%5E%29%5Cw%2Fi'
          9        SEND_VAL                                                 ~4
    7    10        SEND_VAL                                                 '%2A'
    8    11        SEND_VAR                                                 !0
    5    12        DO_ICALL                                         $5      
    8    13      > RETURN                                                   $5
   10    14*     > RETURN                                                   null

End of function filterwords

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.96 ms | 1013 KiB | 16 Q