3v4l.org

run code in 500+ PHP versions simultaneously
<?php function link2code($link) { $arr = array('http:/', 'https:', 'ftp://', 'ftps:/'); If(in_array(substr($link,0,6), $arr)){ return "<a href=\"$link\">$link</a>"; } else { echo('Please provide whole link with protocol part, for example: http://myawesomewebsite.com'); } } echo link2code("https://127.0.0.1");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/meI1r
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'link2code'
          1        SEND_VAL                                                     'https%3A%2F%2F127.0.0.1'
          2        DO_FCALL                                          0  $0      
          3        ECHO                                                         $0
          4      > RETURN                                                       1

Function link2code:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/meI1r
function name:  link2code
number of ops:  15
compiled vars:  !0 = $link, !1 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, <array>
    5     2        FRAMELESS_ICALL_3                substr              ~3      !0, 0
          3        OP_DATA                                                      6
          4        FRAMELESS_ICALL_2                in_array            ~4      ~3, !1
          5      > JMPZ                                                         ~4, ->13
    6     6    >   ROPE_INIT                                         5  ~6      '%3Ca+href%3D%22'
          7        ROPE_ADD                                          1  ~6      ~6, !0
          8        ROPE_ADD                                          2  ~6      ~6, '%22%3E'
          9        ROPE_ADD                                          3  ~6      ~6, !0
         10        ROPE_END                                          4  ~5      ~6, '%3C%2Fa%3E'
         11      > RETURN                                                       ~5
    5    12*       JMP                                                          ->14
    8    13    >   ECHO                                                         'Please+provide+whole+link+with+protocol+part%2C+for+example%3A+http%3A%2F%2Fmyawesomewebsite.com'
   10    14      > RETURN                                                       null

End of function link2code

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.13 ms | 2542 KiB | 14 Q