3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '#blitz na subida do alfabarra blitz'; $subpatterns = [ "subida", " de", " do", " da", "em", " na", " no", "blitz", ]; $subs = array_map( fn($v) => (str_starts_with($v, ' ') ? '' : ' ?\b(?<!#)') . preg_quote($v) . '\b', $subpatterns ); echo preg_replace( '~' . implode('|', $subs) . '~u', '', $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2vtGJ
function name:  (null)
number of ops:  21
compiled vars:  !0 = $str, !1 = $subpatterns, !2 = $subs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%23blitz+na+subida+do+alfabarra+blitz'
    5     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'array_map'
   17     3        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
   18     4        SEND_VAL                                                 ~5
   19     5        SEND_VAR                                                 !1
   16     6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   22     8        INIT_FCALL                                               'preg_replace'
   23     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%7C'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      '%7E', $8
         14        CONCAT                                           ~10     ~9, '%7Eu'
         15        SEND_VAL                                                 ~10
   24    16        SEND_VAL                                                 ''
   25    17        SEND_VAR                                                 !0
   22    18        DO_ICALL                                         $11     
   25    19        ECHO                                                     $11
   26    20      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2vtGJ
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'str_starts_with'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '+'
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->8
          6    >   QM_ASSIGN                                        ~2      ''
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~2      '+%3F%5Cb%28%3F%3C%21%23%29'
   18     9    >   INIT_FCALL                                               'preg_quote'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        CONCAT                                           ~4      ~2, $3
         13        CONCAT                                           ~5      ~4, '%5Cb'
         14      > RETURN                                                   ~5
         15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.6 ms | 1007 KiB | 18 Q