3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach(array( '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 = array(); if(isset($path['scheme'])) $ta = array_merge($ta, array($path['scheme'], ":")); if(isset($path['host'])) $ta[] = "//"; if(isset($path['user'])) $ta[] = $path['user']; if(isset($path['pass'])) $ta = array_merge($ta, array(":", $path['pass'])); if(isset($path['user'])) $ta[] = "@"; if(isset($path['host'])) $ta[] = $path['host']; if(isset($path['port'])) $ta = array_merge($ta, array(":", $path['port'])); if(isset($path['path'])) $ta[] = "[{$path['path']}]"; if(isset($path['query'])) $ta = array_merge($ta, array("?", $path['query'])); if(isset($path['fragment'])) $ta = array_merge($ta, array("#", $path['fragment'])); print implode(" ", $ta) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 98
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 98
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 = 74
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 84
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 94
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 94
Branch analysis from position: 84
Branch analysis from position: 74
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: 98
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 98
filename:       /in/P9NR0
function name:  (null)
number of ops:  100
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>, ->98
          1    > > FE_FETCH_R                                                   $3, !0, ->98
   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, ->74
   50    68    >   ROPE_INIT                                         3  ~41     '%5B'
         69        FETCH_DIM_R                                          ~39     !1, 'path'
         70        ROPE_ADD                                          1  ~41     ~41, ~39
         71        ROPE_END                                          2  ~40     ~41, '%5D'
         72        ASSIGN_DIM                                                   !2
         73        OP_DATA                                                      ~40
   52    74    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'query'
         75      > JMPZ                                                         ~43, ->84
   53    76    >   INIT_FCALL                                                   'array_merge'
         77        SEND_VAR                                                     !2
         78        INIT_ARRAY                                           ~44     '%3F'
         79        FETCH_DIM_R                                          ~45     !1, 'query'
         80        ADD_ARRAY_ELEMENT                                    ~44     ~45
         81        SEND_VAL                                                     ~44
         82        DO_ICALL                                             $46     
         83        ASSIGN                                                       !2, $46
   55    84    >   ISSET_ISEMPTY_DIM_OBJ                             0          !1, 'fragment'
         85      > JMPZ                                                         ~48, ->94
   56    86    >   INIT_FCALL                                                   'array_merge'
         87        SEND_VAR                                                     !2
         88        INIT_ARRAY                                           ~49     '%23'
         89        FETCH_DIM_R                                          ~50     !1, 'fragment'
         90        ADD_ARRAY_ELEMENT                                    ~49     ~50
         91        SEND_VAL                                                     ~49
         92        DO_ICALL                                             $51     
         93        ASSIGN                                                       !2, $51
   58    94    >   FRAMELESS_ICALL_2                implode             ~53     '+', !2
         95        CONCAT                                               ~54     ~53, '%0A'
         96        ECHO                                                         ~54
    3    97      > JMP                                                          ->1
         98    >   FE_FREE                                                      $3
   59    99      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.64 ms | 3049 KiB | 15 Q