3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text ="I found some really good articles on such and such topic. Here are a few links to check out: http://www.example.com/hOSDHOUA and https://www.mywebsite.com/h/yIFeelLowIfImHigh and http://example-site.com/today-is-a-beautiful-day/. "; $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // The Text you want to filter for urls // I will provide it if needed. // Check if there is a url in the text if(preg_match($reg_exUrl, $text, $url)) { // make the urls hyper links echo preg_replace($reg_exUrl, "<a href={$url[0]}>{$url[0]}</a> ", $text); // <--- Part in question } else { // if no urls in the text just return the text echo $text; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qr9gn
function name:  (null)
number of ops:  24
compiled vars:  !0 = $text, !1 = $reg_exUrl, !2 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'I+found+some+really+good+articles+on+such+and+such+topic.+Here+are+a+few+links+to+check+out%3A+http%3A%2F%2Fwww.example.com%2FhOSDHOUA+and+https%3A%2F%2Fwww.mywebsite.com%2Fh%2FyIFeelLowIfImHigh+and+http%3A%2F%2Fexample-site.com%2Ftoday-is-a-beautiful-day%2F.+'
    4     1        ASSIGN                                                   !1, '%2F%28http%7Chttps%7Cftp%7Cftps%29%5C%3A%5C%2F%5C%2F%5Ba-zA-Z0-9%5C-%5C.%5D%2B%5C.%5Ba-zA-Z%5D%7B2%2C3%7D%28%5C%2F%5CS%2A%29%3F%2F'
    8     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->22
   11     8    >   INIT_FCALL                                               'preg_replace'
          9        SEND_VAR                                                 !1
         10        ROPE_INIT                                     5  ~9      '%3Ca+href%3D'
         11        FETCH_DIM_R                                      ~6      !2, 0
         12        ROPE_ADD                                      1  ~9      ~9, ~6
         13        ROPE_ADD                                      2  ~9      ~9, '%3E'
         14        FETCH_DIM_R                                      ~7      !2, 0
         15        ROPE_ADD                                      3  ~9      ~9, ~7
         16        ROPE_END                                      4  ~8      ~9, '%3C%2Fa%3E+'
         17        SEND_VAL                                                 ~8
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $12     
         20        ECHO                                                     $12
         21      > JMP                                                      ->23
   15    22    >   ECHO                                                     !0
   16    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.36 ms | 1400 KiB | 17 Q