3v4l.org

run code in 500+ 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:  9
compiled vars:  !0 = $text, !1 = $bannedWords
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    6     2        FRAMELESS_ICALL_2                implode             ~2      '%7C', !1
          3        CONCAT                                               ~3      '%2F%28%3F%3D%5Cb%28%3F%3A', ~2
          4        CONCAT                                               ~4      ~3, '%29%5Cb%29%5Cw%7C%5CG%28%3F%21%5E%29%5Cw%2Fi'
    5     5        FRAMELESS_ICALL_3                preg_replace        ~5      ~4, '%2A'
    8     6        OP_DATA                                                      !0
          7      > RETURN                                                       ~5
   10     8*     > RETURN                                                       null

End of function filterwords

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
228.2 ms | 1586 KiB | 14 Q