3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = array( '#tag', 'text #tag text', 'text #tag', 'text#tag', ); $res = preg_replace('/(?<=^|\s)#\S{1,24}+(?=$|\s)/u', '#<$1>' , $var); print_r($res); echo preg_replace('/\B#(\S{1,24}+)/u', '<$0>' , '#111 тапинамбур#222 #333 #444');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b6p2V
function name:  (null)
number of ops:  17
compiled vars:  !0 = $var, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3F%3C%3D%5E%7C%5Cs%29%23%5CS%7B1%2C24%7D%2B%28%3F%3D%24%7C%5Cs%29%2Fu'
          3        SEND_VAL                                                 '%23%3C%241%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    9     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5CB%23%28%5CS%7B1%2C24%7D%2B%29%2Fu'
         12        SEND_VAL                                                 '%3C%240%3E'
         13        SEND_VAL                                                 '%23111+%D1%82%D0%B0%D0%BF%D0%B8%D0%BD%D0%B0%D0%BC%D0%B1%D1%83%D1%80%23222+%23333+%23444'
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.18 ms | 1386 KiB | 17 Q