3v4l.org

run code in 300+ PHP versions simultaneously
<?php function makeLink($string){ /*** make sure there is an http:// on all URLs ***/ $string = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i", "$1http://$2",$string); /*** make all URLs links ***/ $string = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"$1\">$1</A>",$string); /*** make all emails hot links ***/ $string = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i","<A HREF=\"mailto:$1\">$1</A>",$string); return $string; } echo makeLink('http://snoodo.com');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcLKO
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'makelink'
          1        SEND_VAL                                                 'http%3A%2F%2Fsnoodo.com'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function makelink:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcLKO
function name:  makeLink
number of ops:  21
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5B%5E%5Cw%5C%2F%5D%29%28www%5C.%5Ba-z0-9%5C-%5D%2B%5C.%5Ba-z0-9%5C-%5D%2B%29%2Fi'
          3        SEND_VAL                                                 '%241http%3A%2F%2F%242'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    7     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%28%5B%5Cw%5D%2B%3A%5C%2F%5C%2F%5B%5Cw-%3F%26%3B%23%7E%3D%5C.%5C%2F%5C%40%5D%2B%5B%5Cw%5C%2F%5D%29%2Fi'
          9        SEND_VAL                                                 '%3Ca+target%3D%22_blank%22+href%3D%22%241%22%3E%241%3C%2FA%3E'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        ASSIGN                                                   !0, $3
    9    13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%28%5B%5Cw-%3F%26%3B%23%7E%3D%5C.%5C%2F%5D%2B%5C%40%28%5C%5B%3F%29%5Ba-zA-Z0-9%5C-%5C.%5D%2B%5C.%28%5Ba-zA-Z%5D%7B2%2C3%7D%7C%5B0-9%5D%7B1%2C3%7D%29%28%5C%5D%3F%29%29%2Fi'
         15        SEND_VAL                                                 '%3CA+HREF%3D%22mailto%3A%241%22%3E%241%3C%2FA%3E'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $5      
         18        ASSIGN                                                   !0, $5
   11    19      > RETURN                                                   !0
   12    20*     > RETURN                                                   null

End of function makelink

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.29 ms | 1398 KiB | 16 Q