3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reg_exUrl = "/((http|https|ftp|ftps)\:\/\/|(www)\.)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; $text = 'lol www.google.bg is an awesome website;'; if(preg_match($reg_exUrl, $text, $url)) { // make the urls hyper links $new_text = preg_replace($reg_exUrl, '<a href="'.$url[0].'" target="_blank">'.$url[0].'</a> ', $text); } else { // if no urls in the text just return the text echo $text; } echo $new_text;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q5B9E
function name:  (null)
number of ops:  24
compiled vars:  !0 = $reg_exUrl, !1 = $text, !2 = $url, !3 = $new_text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, '%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'
    2     1        ASSIGN                                                   !1, 'lol+www.google.bg+is+an+awesome+website%3B'
    3     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $6      
          7      > JMPZ                                                     $6, ->21
    6     8    >   INIT_FCALL                                               'preg_replace'
          9        SEND_VAR                                                 !0
         10        FETCH_DIM_R                                      ~7      !2, 0
         11        CONCAT                                           ~8      '%3Ca+href%3D%22', ~7
         12        CONCAT                                           ~9      ~8, '%22+target%3D%22_blank%22%3E'
         13        FETCH_DIM_R                                      ~10     !2, 0
         14        CONCAT                                           ~11     ~9, ~10
         15        CONCAT                                           ~12     ~11, '%3C%2Fa%3E+'
         16        SEND_VAL                                                 ~12
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !3, $13
         20      > JMP                                                      ->22
   11    21    >   ECHO                                                     !1
   15    22    >   ECHO                                                     !3
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.87 ms | 1395 KiB | 17 Q