3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(https?:\/\/|(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?)/m'; $str = 'Our website is <a href="www.me.com">www.me.com</a>'; $subst = '[x]'; $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/fFhOk
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%28https%3F%3A%5C%2F%5C%2F%7C%28www%5C.%29%3F%5Ba-z0-9%5D%2B%28%5B%5C-%5C.%5D%7B1%7D%5Ba-z0-9%5D%2B%29%2A%5C.%5Ba-z%5D%7B2%2C5%7D%28%3A%5B0-9%5D%7B1%2C5%7D%29%3F%28%5C%2F.%2A%29%3F%29%2Fm'
    4     1        ASSIGN                                                   !1, 'Our+website+is+%3Ca+href%3D%22www.me.com%22%3Ewww.me.com%3C%2Fa%3E'
    5     2        ASSIGN                                                   !2, '%5Bx%5D'
    7     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
    9     9        ECHO                                                     !3
   10    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.21 ms | 1009 KiB | 14 Q