3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach([ 'scheme://user@host/path', 'scheme://host/path', '/path', 'path', '//host/path', 'x:/path', 'scheme:///path', 'file:///path', 'file:/path', 'file:path', ] as $url) { print "\n: $url\n"; if($url === '--') continue; $path = parse_url($url); if($path === false) { print '"Seriously malformed URL." (q) https://php.net/parse_url' . "\n"; continue; } $ta = []; if(isset($path['scheme'])) $ta = array_merge($ta, [$path['scheme'], ":"]); if(isset($path['host']))// || (isset($path['scheme']) && isset($path['path']))) $ta[] = "//"; if(isset($path['user'])) $ta[] = $path['user']; if(isset($path['pass'])) $ta = array_merge($ta, [":", $path['pass']]); if(isset($path['user'])) $ta[] = "@"; if(isset($path['host'])) $ta[] = $path['host']; if(isset($path['port'])) $ta = array_merge($ta, [":", $path['port']]); if(isset($path['path'])) $ta[] = $path['path']; if(isset($path['query'])) $ta = array_merge($ta, ["?", $path['query']]); if(isset($path['fragment'])) $ta = array_merge($ta, ["#", $path['fragment']]); print implode(" ", $ta) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 95
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 95
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 66
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 81
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 91
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 91
Branch analysis from position: 81
Branch analysis from position: 71
Branch analysis from position: 66
Branch analysis from position: 56
Branch analysis from position: 51
Branch analysis from position: 47
Branch analysis from position: 37
Branch analysis from position: 32
Branch analysis from position: 28
Branch analysis from position: 95
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 95
filename:       /in/8tMlW
function name:  (null)
number of ops:  97
compiled vars:  !0 = $url, !1 = $path, !2 = $ta
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E > > FE_RESET_R                                           $3      <array>, ->95
          1    > > FE_FETCH_R                                                   $3, !0, ->95
   15     2    >   ROPE_INIT                                         3  ~5      '%0A%3A+'
          3        ROPE_ADD                                          1  ~5      ~5, !0
          4        ROPE_END                                          2  ~4      ~5, '%0A'
          5        ECHO                                                         ~4
   16     6        IS_IDENTICAL                                                 !0, '--'
          7      > JMPZ                                                         ~7, ->9
   17     8    > > JMP                                                          ->1
   19     9    >   INIT_FCALL                                                   'parse_url'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                             $8      
         12        ASSIGN                                                       !1, $8
   20    13        TYPE_CHECK                                        4          !1
         14      > JMPZ                                                         ~10, ->17
   22    15    >   ECHO                                                         '%22Seriously+malformed+URL.%22+%28q%29+https%3A%2F%2Fphp.net%2Fparse_url%0A'
   23    16      > JMP                                                          ->1
   26    17    >   ASSIGN                                                       !2, <array>
   28    18        ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'scheme'
         19      > JMPZ                                                         ~12, ->28
   29    20    >   INIT_FCALL                                                   'array_merge'
         21        SEND_VAR                                                     !2
         22        FETCH_DIM_R                                          ~13     !1, 'scheme'
         23        INIT_ARRAY                                           ~14     ~13
         24        ADD_ARRAY_ELEMENT                                    ~14     '%3A'
         25        SEND_VAL                                                     ~14
         26        DO_ICALL                                             $15     
         27        ASSIGN                                                       !2, $15
   31    28    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'host'
         29      > JMPZ                                                         ~17, ->32
   32    30    >   ASSIGN_DIM                                                   !2
         31        OP_DATA                                                      '%2F%2F'
   34    32    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'user'
         33      > JMPZ                                                         ~19, ->37
   35    34    >   FETCH_DIM_R                                          ~21     !1, 'user'
         35        ASSIGN_DIM                                                   !2
         36        OP_DATA                                                      ~21
   37    37    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'pass'
         38      > JMPZ                                                         ~22, ->47
   38    39    >   INIT_FCALL                                                   'array_merge'
         40        SEND_VAR                                                     !2
         41        INIT_ARRAY                                           ~23     '%3A'
         42        FETCH_DIM_R                                          ~24     !1, 'pass'
         43        ADD_ARRAY_ELEMENT                                    ~23     ~24
         44        SEND_VAL                                                     ~23
         45        DO_ICALL                                             $25     
         46        ASSIGN                                                       !2, $25
   40    47    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'user'
         48      > JMPZ                                                         ~27, ->51
   41    49    >   ASSIGN_DIM                                                   !2
         50        OP_DATA                                                      '%40'
   43    51    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'host'
         52      > JMPZ                                                         ~29, ->56
   44    53    >   FETCH_DIM_R                                          ~31     !1, 'host'
         54        ASSIGN_DIM                                                   !2
         55        OP_DATA                                                      ~31
   46    56    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'port'
         57      > JMPZ                                                         ~32, ->66
   47    58    >   INIT_FCALL                                                   'array_merge'
         59        SEND_VAR                                                     !2
         60        INIT_ARRAY                                           ~33     '%3A'
         61        FETCH_DIM_R                                          ~34     !1, 'port'
         62        ADD_ARRAY_ELEMENT                                    ~33     ~34
         63        SEND_VAL                                                     ~33
         64        DO_ICALL                                             $35     
         65        ASSIGN                                                       !2, $35
   49    66    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'path'
         67      > JMPZ                                                         ~37, ->71
   50    68    >   FETCH_DIM_R                                          ~39     !1, 'path'
         69        ASSIGN_DIM                                                   !2
         70        OP_DATA                                                      ~39
   52    71    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'query'
         72      > JMPZ                                                         ~40, ->81
   53    73    >   INIT_FCALL                                                   'array_merge'
         74        SEND_VAR                                                     !2
         75        INIT_ARRAY                                           ~41     '%3F'
         76        FETCH_DIM_R                                          ~42     !1, 'query'
         77        ADD_ARRAY_ELEMENT                                    ~41     ~42
         78        SEND_VAL                                                     ~41
         79        DO_ICALL                                             $43     
         80        ASSIGN                                                       !2, $43
   55    81    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'fragment'
         82      > JMPZ                                                         ~45, ->91
   56    83    >   INIT_FCALL                                                   'array_merge'
         84        SEND_VAR                                                     !2
         85        INIT_ARRAY                                           ~46     '%23'
         86        FETCH_DIM_R                                          ~47     !1, 'fragment'
         87        ADD_ARRAY_ELEMENT                                    ~46     ~47
         88        SEND_VAL                                                     ~46
         89        DO_ICALL                                             $48     
         90        ASSIGN                                                       !2, $48
   58    91    >   FRAMELESS_ICALL_2                implode             ~50     '+', !2
         92        CONCAT                                               ~51     ~50, '%0A'
         93        ECHO                                                         ~51
    3    94      > JMP                                                          ->1
         95    >   FE_FREE                                                      $3
   59    96      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.45 ms | 3019 KiB | 15 Q