3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'ê[B]éîøoo[/B]åaí'; $isMatch = preg_match( '/\[(\w++)([=]?)([^\]]*?)\]([^\[]*?)\[\/\1\]|\[(HR|\*)\]/', $string, $matches ); if($isMatch) { echo str_replace( "[{$matches[1]}]{$matches[4]}[/{$matches[1]}]", $tag, $string ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/mQFkX
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string, !1 = $isMatch, !2 = $matches, !3 = $tag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%C3%AA%5BB%5D%C3%A9%C3%AE%C3%B8oo%5B%2FB%5D%C3%A5a%C3%AD'
    4     1        INIT_FCALL                                               'preg_match'
    5     2        SEND_VAL                                                 '%2F%5C%5B%28%5Cw%2B%2B%29%28%5B%3D%5D%3F%29%28%5B%5E%5C%5D%5D%2A%3F%29%5C%5D%28%5B%5E%5C%5B%5D%2A%3F%29%5C%5B%5C%2F%5C1%5C%5D%7C%5C%5B%28HR%7C%5C%2A%29%5C%5D%2F'
    6     3        SEND_VAR                                                 !0
    7     4        SEND_REF                                                 !2
          5        DO_ICALL                                         $5      
    4     6        ASSIGN                                                   !1, $5
   10     7      > JMPZ                                                     !1, ->24
   11     8    >   INIT_FCALL                                               'str_replace'
   12     9        ROPE_INIT                                     7  ~11     '%5B'
         10        FETCH_DIM_R                                      ~7      !2, 1
         11        ROPE_ADD                                      1  ~11     ~11, ~7
         12        ROPE_ADD                                      2  ~11     ~11, '%5D'
         13        FETCH_DIM_R                                      ~8      !2, 4
         14        ROPE_ADD                                      3  ~11     ~11, ~8
         15        ROPE_ADD                                      4  ~11     ~11, '%5B%2F'
         16        FETCH_DIM_R                                      ~9      !2, 1
         17        ROPE_ADD                                      5  ~11     ~11, ~9
         18        ROPE_END                                      6  ~10     ~11, '%5D'
         19        SEND_VAL                                                 ~10
   13    20        SEND_VAR                                                 !3
   14    21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $15     
         23        ECHO                                                     $15
   16    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.59 ms | 1395 KiB | 17 Q