3v4l.org

run code in 300+ PHP versions simultaneously
<?php $links = array( 'test.com', 'http://test.net', 'https://secure.net', 'www.test.net', 'spotify:csad456ds4a6d', 'hey', 'hey.net', 'mailto:victor.loux@mtcmedia.co.uk', '192.168.0.1', 'ftp://test@mtcmedia.co.uk' ); foreach($links as $link) { if(parse_url($link, PHP_URL_SCHEME) == '') { $link = 'http://' . $link; } echo $link . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/IsVHr
function name:  (null)
number of ops:  16
compiled vars:  !0 = $links, !1 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   15     1      > FE_RESET_R                                       $3      !0, ->14
          2    > > FE_FETCH_R                                               $3, !1, ->14
   16     3    >   INIT_FCALL                                               'parse_url'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 0
          6        DO_ICALL                                         $4      
          7        IS_EQUAL                                                 $4, ''
          8      > JMPZ                                                     ~5, ->11
   17     9    >   CONCAT                                           ~6      'http%3A%2F%2F', !1
         10        ASSIGN                                                   !1, ~6
   20    11    >   CONCAT                                           ~8      !1, '%0A'
         12        ECHO                                                     ~8
   15    13      > JMP                                                      ->2
         14    >   FE_FREE                                                  $3
   21    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.35 ms | 1395 KiB | 15 Q