3v4l.org

run code in 500+ PHP versions simultaneously
<?php function convert_instagram_links( $instagram_caption_a_title ) { // Create links from @mentions, #hashtags and regular links. $instagram_caption_a_title = preg_replace( '~https?://[^<>\s]+~i', '<a href="$0" target="_blank">$0</a>', $instagram_caption_a_title ); $instagram_caption = preg_replace( '/#+(\w+)/u', '<a href="https://www.instagram.com/explore/tags/$1" target="_blank">$0</a>', $instagram_caption_a_title ); $instagram_caption = preg_replace( '/@+(\w+)/u', '<a href="https://www.instagram.com/$1" target="_blank">@$1</a>', $instagram_caption ); return $instagram_caption; } echo convert_instagram_links('@tags_underscore or #hashtags_underscore');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6l7E5
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'convert_instagram_links'
          1        SEND_VAL                                                     '%40tags_underscore+or+%23hashtags_underscore'
          2        DO_FCALL                                          0  $0      
          3        ECHO                                                         $0
          4      > RETURN                                                       1

Function convert_instagram_links:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6l7E5
function name:  convert_instagram_links
number of ops:  12
compiled vars:  !0 = $instagram_caption_a_title, !1 = $instagram_caption
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        FRAMELESS_ICALL_3                preg_replace        ~2      '%7Ehttps%3F%3A%2F%2F%5B%5E%3C%3E%5Cs%5D%2B%7Ei', '%3Ca+href%3D%22%240%22+target%3D%22_blank%22%3E%240%3C%2Fa%3E'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !0, ~2
    6     4        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%23%2B%28%5Cw%2B%29%2Fu', '%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fexplore%2Ftags%2F%241%22+target%3D%22_blank%22%3E%240%3C%2Fa%3E'
          5        OP_DATA                                                      !0
          6        ASSIGN                                                       !1, ~4
    7     7        FRAMELESS_ICALL_3                preg_replace        ~6      '%2F%40%2B%28%5Cw%2B%29%2Fu', '%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2F%241%22+target%3D%22_blank%22%3E%40%241%3C%2Fa%3E'
          8        OP_DATA                                                      !1
          9        ASSIGN                                                       !1, ~6
    8    10      > RETURN                                                       !1
    9    11*     > RETURN                                                       null

End of function convert_instagram_links

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.39 ms | 2055 KiB | 14 Q