3v4l.org

run code in 300+ 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:  11
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        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
   11     9        ECHO                                                     !3
   12    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.01 ms | 1000 KiB | 14 Q