3v4l.org

run code in 300+ 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:  21
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        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7Ehttps%3F%3A%2F%2F%5B%5E%3C%3E%5Cs%5D%2B%7Ei'
          3        SEND_VAL                                                 '%3Ca+href%3D%22%240%22+target%3D%22_blank%22%3E%240%3C%2Fa%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    6     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%23%2B%28%5Cw%2B%29%2Fu'
          9        SEND_VAL                                                 '%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fexplore%2Ftags%2F%241%22+target%3D%22_blank%22%3E%240%3C%2Fa%3E'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        ASSIGN                                                   !1, $4
    7    13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%40%2B%28%5Cw%2B%29%2Fu'
         15        SEND_VAL                                                 '%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2F%241%22+target%3D%22_blank%22%3E%40%241%3C%2Fa%3E'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $6      
         18        ASSIGN                                                   !1, $6
    8    19      > RETURN                                                   !1
    9    20*     > RETURN                                                   null

End of function convert_instagram_links

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.32 ms | 1403 KiB | 16 Q