3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/(text)(?!<\/a>)/m'; $str = 'this is sample text about something what is text. this is sample <a href=\'somelink.php\'>text</a> about something what is <a href=\'somelink.php\'>text</a>.'; $subst = '<a href=\'somelink.php\'>$1</a>'; $result = preg_replace($re, $subst, $str); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DVTB1
function name:  (null)
number of ops:  8
compiled vars:  !0 = $re, !1 = $str, !2 = $subst, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2F%28text%29%28%3F%21%3C%5C%2Fa%3E%29%2Fm'
    4     1        ASSIGN                                                       !1, 'this+is+sample+text+about+something+what+is+text.%0A%0Athis+is+sample+%3Ca+href%3D%27somelink.php%27%3Etext%3C%2Fa%3E+about+something+what+is+%3Ca+href%3D%27somelink.php%27%3Etext%3C%2Fa%3E.'
    7     2        ASSIGN                                                       !2, '%3Ca+href%3D%27somelink.php%27%3E%241%3C%2Fa%3E'
    9     3        FRAMELESS_ICALL_3                preg_replace        ~7      !0, !2
          4        OP_DATA                                                      !1
          5        ASSIGN                                                       !3, ~7
   11     6        ECHO                                                         !3
   12     7      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.09 ms | 2674 KiB | 13 Q