3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = ' sdfsdaf sdafadsf #test sdfdsf'; $text = preg_replace('%(\A#(\w|(\p{L}\p{M}?)|-)+\b)|((?<=\s)#(\w|(\p{L}\p{M}?)|-)+\b)|((?<=\[)#.+?(?=\]))%u', '<a class="hashtag" href="https://google.com/?q='.urlencode('$3').'" target="_blank">$3</a>', $text, 10); echo ($text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qNuc6
function name:  (null)
number of ops:  15
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '+sdfsdaf+sdafadsf+%23test+sdfdsf'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%25%28%5CA%23%28%5Cw%7C%28%5Cp%7BL%7D%5Cp%7BM%7D%3F%29%7C-%29%2B%5Cb%29%7C%28%28%3F%3C%3D%5Cs%29%23%28%5Cw%7C%28%5Cp%7BL%7D%5Cp%7BM%7D%3F%29%7C-%29%2B%5Cb%29%7C%28%28%3F%3C%3D%5C%5B%29%23.%2B%3F%28%3F%3D%5C%5D%29%29%25u'
    6     3        INIT_FCALL                                               'urlencode'
          4        SEND_VAL                                                 '%243'
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      '%3Ca+class%3D%22hashtag%22+href%3D%22https%3A%2F%2Fgoogle.com%2F%3Fq%3D', $2
          7        CONCAT                                           ~4      ~3, '%22+target%3D%22_blank%22%3E%243%3C%2Fa%3E'
          8        SEND_VAL                                                 ~4
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 10
         11        DO_ICALL                                         $5      
    5    12        ASSIGN                                                   !0, $5
    8    13        ECHO                                                     !0
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.11 ms | 1386 KiB | 17 Q