3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modifyText($text) { $url = '~https?://[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}(?:\/\S*(?<!\.))?~'; $string= preg_replace($url, '<a href="$0" target="_blank">$0</a>', $text); return $string; } echo modifyText("Example text... https://example.com/site. More text here... https://example.com/site");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kO6q5
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'modifytext'
          1        SEND_VAL                                                 'Example+text...+https%3A%2F%2Fexample.com%2Fsite.+More+text+here...+https%3A%2F%2Fexample.com%2Fsite'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function modifytext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kO6q5
function name:  modifyText
number of ops:  10
compiled vars:  !0 = $text, !1 = $url, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '%7Ehttps%3F%3A%2F%2F%5Ba-zA-Z0-9.-%5D%2B%5C.%5Ba-zA-Z%5D%7B2%2C3%7D%28%3F%3A%5C%2F%5CS%2A%28%3F%3C%21%5C.%29%29%3F%7E'
    5     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%3Ca+href%3D%22%240%22+target%3D%22_blank%22%3E%240%3C%2Fa%3E'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !2, $4
    6     8      > RETURN                                                   !2
    7     9*     > RETURN                                                   null

End of function modifytext

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.95 ms | 1004 KiB | 15 Q