3v4l.org

run code in 500+ PHP versions simultaneously
<?php $subcat = 1; $cat = 2; $text = 'This is a non-qualifying#HashTag and this has white space before it #Test9 and some more text.'; $text = preg_replace('/(?<!\S)#\K[\da-z]+/i', "<a href=\"https://somesite.com/search?cityid=0&lang=en&search=\\0&subcatid=$subcat&view=ads&catid=$cat\">#\\0</a>", $text); echo $text;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VguUV
function name:  (null)
number of ops:  13
compiled vars:  !0 = $subcat, !1 = $cat, !2 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 1
    3     1        ASSIGN                                                       !1, 2
    4     2        ASSIGN                                                       !2, 'This+is+a+non-qualifying%23HashTag+and+this+has+white+space+before+it+%23Test9+and+some+more+text.'
    5     3        ROPE_INIT                                         5  ~7      '%3Ca+href%3D%22https%3A%2F%2Fsomesite.com%2Fsearch%3Fcityid%3D0%26lang%3Den%26search%3D%5C0%26subcatid%3D'
          4        ROPE_ADD                                          1  ~7      ~7, !0
          5        ROPE_ADD                                          2  ~7      ~7, '%26view%3Dads%26catid%3D'
          6        ROPE_ADD                                          3  ~7      ~7, !1
          7        ROPE_END                                          4  ~6      ~7, '%22%3E%23%5C0%3C%2Fa%3E'
          8        FRAMELESS_ICALL_3                preg_replace        ~10     '%2F%28%3F%3C%21%5CS%29%23%5CK%5B%5Cda-z%5D%2B%2Fi', ~6
          9        OP_DATA                                                      !2
         10        ASSIGN                                                       !2, ~10
    7    11        ECHO                                                         !2
    8    12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.65 ms | 2582 KiB | 13 Q