3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str="Link type 1 - www.google.com <br>link type 2 - http://www.goe3ogLEe.com <br>link type 3 - https://www.google.com <br>link type 4 - http://google.com <br>Link type 5 - http://www.vistaprint.com/local-search-profile.aspx?txi=15664&xnid=TopNav_Local+Search+Profile+ %28linked+item%29_Websites&xnav=TopNav <br>Link type 6 - http://drive.google.com/?tab=mo&authuser=0#folders/0B7ZWeOAbtjQ1OHR1Yf343f33N2M "; $pattern = '#(www\.|https?://)?[\w\d]+\.[\d\w]{2}\S*#i'; $str1=preg_replace($pattern, '<a href="$0">$0</a>', $str); $str1=str_replace('href="www','href="http://www',$str1); echo $str1;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rHhiq
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str, !1 = $pattern, !2 = $str1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Link+type+1+-+www.google.com+%3Cbr%3Elink+type+2+-+http%3A%2F%2Fwww.goe3ogLEe.com+%3Cbr%3Elink+type+3+-+https%3A%2F%2Fwww.google.com+%3Cbr%3Elink+type+4+%0A%0A-+http%3A%2F%2Fgoogle.com+%3Cbr%3ELink+type+5+-+http%3A%2F%2Fwww.vistaprint.com%2Flocal-search-profile.aspx%3Ftxi%3D15664%26xnid%3DTopNav_Local%2BSearch%2BProfile%2B%0A%0A%2528linked%2Bitem%2529_Websites%26xnav%3DTopNav+%3Cbr%3ELink+type+6+-+http%3A%2F%2Fdrive.google.com%2F%3Ftab%3Dmo%26authuser%3D0%23folders%2F0B7ZWeOAbtjQ1OHR1Yf343f33N2M+'
    8     1        ASSIGN                                                   !1, '%23%28www%5C.%7Chttps%3F%3A%2F%2F%29%3F%5B%5Cw%5Cd%5D%2B%5C.%5B%5Cd%5Cw%5D%7B2%7D%5CS%2A%23i'
    9     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%3Ca+href%3D%22%240%22%3E%240%3C%2Fa%3E'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   10     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 'href%3D%22www'
         10        SEND_VAL                                                 'href%3D%22http%3A%2F%2Fwww'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
   11    14        ECHO                                                     !2
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1399 KiB | 18 Q