3v4l.org

run code in 300+ 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 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/meI1r
function name:  link2code
number of ops:  21
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        INIT_FCALL                                               'in_array'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 6
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $4      
         11      > JMPZ                                                     $4, ->19
    6    12    >   ROPE_INIT                                     5  ~6      '%3Ca+href%3D%22'
         13        ROPE_ADD                                      1  ~6      ~6, !0
         14        ROPE_ADD                                      2  ~6      ~6, '%22%3E'
         15        ROPE_ADD                                      3  ~6      ~6, !0
         16        ROPE_END                                      4  ~5      ~6, '%3C%2Fa%3E'
         17      > RETURN                                                   ~5
    5    18*       JMP                                                      ->20
    8    19    >   ECHO                                                     'Please+provide+whole+link+with+protocol+part%2C+for+example%3A+http%3A%2F%2Fmyawesomewebsite.com'
   10    20      > RETURN                                                   null

End of function link2code

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
244.8 ms | 1004 KiB | 16 Q