3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "demo link edno www.abv.bg link 2 http://abv123.bg/"; $reg_exUrl = "/((http|https|ftp|ftps)\:\/\/|(www)\.)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; if(preg_match($reg_exUrl, $text, $url)) { $text = preg_replace($reg_exUrl, '<a href="'.$url[0].'" target="_blank">'.$url[0].'</a> ', $text); } echo $text;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/ONZ1Y
function name:  (null)
number of ops:  22
compiled vars:  !0 = $text, !1 = $reg_exUrl, !2 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'demo+link+edno+www.abv.bg+link+2+http%3A%2F%2Fabv123.bg%2F'
    3     1        ASSIGN                                                   !1, '%2F%28%28http%7Chttps%7Cftp%7Cftps%29%5C%3A%5C%2F%5C%2F%7C%28www%29%5C.%29%5Ba-zA-Z0-9%5C-%5C.%5D%2B%5C.%5Ba-zA-Z%5D%7B2%2C3%7D%28%5C%2F%5CS%2A%29%3F%2F'
    4     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->20
    5     8    >   INIT_FCALL                                               'preg_replace'
          9        SEND_VAR                                                 !1
         10        FETCH_DIM_R                                      ~6      !2, 0
         11        CONCAT                                           ~7      '%3Ca+href%3D%22', ~6
         12        CONCAT                                           ~8      ~7, '%22+target%3D%22_blank%22%3E'
         13        FETCH_DIM_R                                      ~9      !2, 0
         14        CONCAT                                           ~10     ~8, ~9
         15        CONCAT                                           ~11     ~10, '%3C%2Fa%3E+'
         16        SEND_VAL                                                 ~11
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !0, $12
    8    20    >   ECHO                                                     !0
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.03 ms | 1387 KiB | 17 Q