3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = "<p>Some string www.test.com with urls http://test.com in it http://www.test.com.</p>"; if(preg_match_all("/((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])*/",$text,$urls)){ foreach($urls[0]as $url ){ $text = str_replace($url,'<a href="'.$url.'">'.$url.'</a>',$text); } } echo $text;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 19
filename:       /in/VRXuf
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $urls, !2 = $url
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cp%3ESome+string+www.test.com+with+urls+http%3A%2F%2Ftest.com+in+it+http%3A%2F%2Fwww.test.com.%3C%2Fp%3E'
    5     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%28%28http%7Chttps%29%5C%3A%5C%2F%5C%2F%29%3F%5Ba-zA-Z0-9%5C.%5C%2F%5C%3F%5C%3A%40%5C-_%3D%23%5D%2B%5C.%28%5Ba-zA-Z0-9%5C%26%5C.%5C%2F%5C%3F%5C%3A%40%5C-_%3D%23%5D%29%2A%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $4      
          6      > JMPZ                                                         $4, ->19
    6     7    >   FETCH_DIM_R                                          ~5      !1, 0
          8      > FE_RESET_R                                           $6      ~5, ->18
          9    > > FE_FETCH_R                                                   $6, !2, ->18
    7    10    >   CONCAT                                               ~7      '%3Ca+href%3D%22', !2
         11        CONCAT                                               ~8      ~7, '%22%3E'
         12        CONCAT                                               ~9      ~8, !2
         13        CONCAT                                               ~10     ~9, '%3C%2Fa%3E'
         14        FRAMELESS_ICALL_3                str_replace         ~11     !2, ~10
         15        OP_DATA                                                      !0
         16        ASSIGN                                                       !0, ~11
    6    17      > JMP                                                          ->9
         18    >   FE_FREE                                                      $6
   11    19    >   ECHO                                                         !0
   12    20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.94 ms | 2143 KiB | 14 Q