3v4l.org

run code in 300+ PHP versions simultaneously
<?php class URI { public static function getRegex() { static $cache; if ($cache) return $cache; ################################################################################### # # pct-encoded := "%" HEXDIG HEXDIG # unreserved := ALPHA / DIGIT / "-" / "." / "_" / "~" # reserved := gen-delims / sub-delims # gen-delims := "#" / "/" / ":" / "?" / "@" / "[" / "]" # sub-delims := "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" # pchar := unreserved / pct-encoded / sub-delims / ":" / "@" $pct_encoded = '\x25[0-9A-Fa-f][0-9A-Fa-f]'; $unreserved = '[\x2d\x2e\x30-\x39\x41-\x5a\x5f\x61-\x7a\x7e\p{L}]'; $gen_dims = '[\x23\x2f\x3a\x3f]'; $sub_delims = '[\x21\x24\x26-\x2c\x3b\x3d\x40\x5b\x5d]'; $reserved = '[\x21\x23\x24\x26-\x2c\x2f\x3a\x3b\x3d\x3f\x40\x5b\x5d]'; $pchar = "(?:[\\x21\\x24\\x26-\\x2e\\x30-\\x3b\\x3d\\x40-\\x5a\\x5f\\x61-\\x7a\\x7e\\p{L}]|$pct_encoded)"; ################################################################################# # # segment := *pchar # segment-nz := 1*pchar # segment-nz-nc := 1*(unreserved / pct-encoded / sub-delims / "@") # ; non-zero-length segment without any colon ":" $segment = "$pchar*"; $segment_nz = "$pchar+"; $segment_nx_nc = "(?:$unreserve|$pct_encoded|$sub_delims|\\x40)+"; ################################################################################# # # path-abempty := *( "/" segment ) # path-absolute := "/" [ segment-nz *( "/" segment ) ] # path-noscheme := segment-nz-nc *( "/" segment ) # path-rootless := segment-nz *( "/" segment ) # path-empty := 0<pchar> $path_abempty = "(P<Path>(?:\\x2f$segment)*)"; $path_absolute = "(P<Path>\\x2f(?:$segment(?:\\x2f$segment)*)?)"; $path_noscheme = "(P<Path>$setment_nz_nc(?:\\x2f$segment)*)"; $path_rootless = "(P<Path>$segment_nz(?:\\x2f$segment)*)"; $path_empty = "(P<Path>)"; ################################################################################## # # IP-literal := "[" (IPv6address / IPvFuture) "]" # # IPvFuture := "v" 1*HEXDIG "." 1*(unreserved / sub-delims / ":") # # IPv6address := 6(h16 ":") ls32 # / "::" 5(h16 ":") ls32 # / [h16] "::" 4(h16 ":") ls32 # / [*1(h16 ":") h16] "::" 3(h16 ":") ls32 # / [*2( h16 ":") h16] "::" 2(h16 ":") ls32 # / [*3(h16 ":") h16] "::" h16 ":" ls32 # / [*4(h16 ":") h16] "::" ls32 # / [*5(h16 ":") h16] "::" h16 # / [*6(h16 ":") h16] "::" # # IPv4address := dec-octet "." dec-octet "." dec-octet "." dec-octet # # h16 := 1*4HEXDIG # ls32 := (h16 ":" h16) / IPv4address # dec-octet := DIGIT ; 0-9 # / %x31-39 DIGIT ; 10-99 # / "1" 2DIGIT ; 100-199 # / "2" %x30-34 DIGIT ; 200-249 # / "25" %x30-35 ; 250-255 $dec_octet = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]'; $IPv4Address = "(P<IPv4Address>$dec_octet\\x2e$dec_octet\\x2e$dec_octet\\x2e$dec_octet)"; $h16 = '[0-9A-Fa-f]{1,4}'; $ls32 = "(?:$h16\\x3a$h16|$IPv4Address)"; $IPv6Address = "(P<IPv6Address>" . "(?:$h16\\x3a){6}$ls32|" . "\\x3a\\x3a(?:$h16\\x3a){5}$ls32|" . "(?:$h16)?\\x3a\\x3a(?:$h16\\x3a){5}$ls32|" . "(?:(?:$h16\\x3a){,1}$h16)?\\x3a\\x3a(?:$h16\\x3a){3}$ls32|" . "(?:(?:$h16\\x3a){,2}$h16)?\\x3a\\x3a(?:$h16\\x3a){2}$ls32|" . "(?:(?:$h16\\x3a){,3}$h16)?\\x3a\\x3a(?:$h16\\x3a){1}$ls32|" . "(?:(?:$h16\\x3a){,4}$h16)?\\x3a\\x3a$ls32|" . "(?:(?:$h16\\x3a){,5}$h16)?\\x3a\\x3a$h16|" . "(?:(?:$h16\\x3a){,6}$h16)?\\x3a\\x3a" . ")"; $IPvFuture = "v[0-9A-Fa-f]+\\x2e(?:$unreserved|$sub_delims|\\x3a)"; $IPvLiteral = "(?:\\x5b$IPv6Address|$IPvFuture\\x5d)"; ################################################################################ # # reg-name := *(unreserved / pct-encoded / sub-delims) $reg_name = "(?:$unreserved|$pct_encoded|$sub_delims)*"; ################################################################################ # # authority := [userinfo "@"] host [":" port] # userinfo := *(unreserved / pct-encoded / sub-delims / ":") # host := IP-literal / IPv4address / reg-name # port := *DIGIT $userninfo = "(P<Userinfo>(?:$unreserved|$pct_encoded|$sub_delims|\\x3a)*)"; $host = "(P<Host>$reg_name|$IPvLiteral|$IPv4Address)"; $port = "(P<Port>[0-9]*)"; $authoritry = "(?:$userinfo\\x40)?$host(?:\\x3a$port)?"; ################################################################################ # # scheme := ALPHA *(ALPHA / DIGIT / "+" / "-" / ".") # hier-part := "//" authority path-abempty # / path-absolute # / path-rootless # / path-empty # # relative-part := "//" authority path-abempty # / path-absolute # / path-rootless # / path-empty # query := *(pchar / "/" / "?") # fragment := *(pchar / "/" / "?") $scheme = '(P<Scheme>[A-Za-z][\x2b\x2d\x2e0-9A-Za-z]*)'; $hier_part = "(?:\\x2f\\x2f$authority$path_abemtpy|$path_absolute|$path_rootless|$path_empty)"; $relative_part = "(?:\\x2f\\x2f$authority$path_abemtpy|$path_absolute|$path_noscheme|$path_empty)"; $query = "(P<Query>(?:$pchar|\x2f|\x3f)*)"; $fragment = "(P<Fragment>(?:$pchar|\x2f|\x3f)*)"; ################################################################################ # # URI-reference := URI / relative-ref # # URI := scheme ":" hier-part ["?" query] ["#" fragment] # # relative-ref := relative-part ["?" query] ["#" fragment] $URI = "(?:$scheme\\x3a$hier_part(?:\\x3f$query)?(?:\\x23$fragment)?"; $relative_ref = "$relative_part(?:\\x3f$query)?(?:\\x23$fragment)?"; $URI_spec = "(P<URI>:$URI|$relative_ref)"; return $cache = $URI_spec; } /** * Resolves dot segments in a path. * * <h3>Introduction</h3> * * <p>This function takes a valid url path and nomalizes it into * the simplest form possible.</p> * * <hr> * * @throws \BLW\Model\InvalidArgumentException If <code>$Path</code> is not a string or is empty. * * @param string $Path Path to normalize. * @param bool $isRelative Whether path is relative or absolute. * @return string Normailized path. */ public static function removeDotSegments($Path, $isRelative = false) { # Not a string or empty if (is_string($Path)? !empty($Path) : false) { # Does path start with "/" $isAbsolute = $Path[0] == '/'; # Does path end with "/" $isTrailingSlash = $Path[strlen($Path) - 1] == '/'; # Split path into segments $Segments = array_values(array_filter(explode("/", $Path), function($v) {return !!$v;})); # Go through parts and resolve dots ("." & "..") for ($up=0, $i=count($Segments)-1; $i>=0; $i--) { # Part is a single dot if ($Segments[$i] == '.') { # Remove it unset($Segments[$i]); } # Part is a double dot elseif ($Segments[$i] == '..') { # Remove it unset($Segments[$i]); # Move up $up++; } # Part is a directory / file else { # did we move up? if ($up) { # Remove it unset($Segments[$i]); #move down $up--; } } } # Recreate path if ($isRelative) { $Path = str_repeat('../', $up) . implode('/', $Segments); } else { $Path = implode('/', $Segments); } # Check results if (empty($Path) && !$isAbsolute) $Path = ''; # Restore trailing slash if (!empty($Path) && $isTrailingSlash) $Path .= '/'; # Restore starting slash if ($isAbsolute) $Path = '/' . $Path; # Done return $Path; } # Path is empty or not a string else throw new InvalidArgumentException(0); # Done return ''; } public static function parse($URI) { # Default return value $return = array( 'Scheme' => '' ,'Userinfo' => '' ,'Host' => '' ,'Port' => '' ,'Path' => '' ,'Query' => '' ,'Fragment' => '' ,'IPv4Address' => '' ,'IPv6Address' => '' ); # Is URI a string? if (is_string($URL) ?: is_callable(array($URI, '__toString'))) { # Run regex if (preg_match('!^'. self::getRegex() .'$!', $URI, $m)) { var_dump($m); } } # Invalid URI else throw new InvalidArgumentException(0); # Done return $return; } } $Test = array( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' ,'http://www.ietf.org/rfc/rfc2396.txt' ,'ldap://[2001:db8::7]/c=GB?objectClass?one' ,'mailto:John.Doe@example.com' ,'news:comp.infosystems.www.servers.unix' ,'tel:+1-816-555-1212' ,'telnet://192.0.2.16:80/' ,'urn:oasis:names:specification:docbook:dtd:xml:4.1.2' ); foreach ($Test as $URI) { URI::parse($URI); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/AfvpI
function name:  (null)
number of ops:  9
compiled vars:  !0 = $Test, !1 = $URI
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  276     0  E >   ASSIGN                                                   !0, <array>
  287     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                               $3, !1, ->7
          3    >   INIT_STATIC_METHOD_CALL                                  'URI', 'parse'
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAfvpI%3A182%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AfvpI
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  182     0  E >   RECV                                             !0      
          1        BOOL_NOT                                         ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAfvpI%3A182%240

Class URI:
Function getregex:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AfvpI
function name:  getRegex
number of ops:  245
compiled vars:  !0 = $cache, !1 = $pct_encoded, !2 = $unreserved, !3 = $gen_dims, !4 = $sub_delims, !5 = $reserved, !6 = $pchar, !7 = $segment, !8 = $segment_nz, !9 = $segment_nx_nc, !10 = $unreserve, !11 = $path_abempty, !12 = $path_absolute, !13 = $path_noscheme, !14 = $setment_nz_nc, !15 = $path_rootless, !16 = $path_empty, !17 = $dec_octet, !18 = $IPv4Address, !19 = $h16, !20 = $ls32, !21 = $IPv6Address, !22 = $IPvFuture, !23 = $IPvLiteral, !24 = $reg_name, !25 = $userninfo, !26 = $host, !27 = $port, !28 = $authoritry, !29 = $userinfo, !30 = $scheme, !31 = $hier_part, !32 = $authority, !33 = $path_abemtpy, !34 = $relative_part, !35 = $query, !36 = $fragment, !37 = $URI, !38 = $relative_ref, !39 = $URI_spec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1      > JMPZ                                                     !0, ->3
          2    > > RETURN                                                   !0
   20     3    >   ASSIGN                                                   !1, '%5Cx25%5B0-9A-Fa-f%5D%5B0-9A-Fa-f%5D'
   21     4        ASSIGN                                                   !2, '%5B%5Cx2d%5Cx2e%5Cx30-%5Cx39%5Cx41-%5Cx5a%5Cx5f%5Cx61-%5Cx7a%5Cx7e%5Cp%7BL%7D%5D'
   22     5        ASSIGN                                                   !3, '%5B%5Cx23%5Cx2f%5Cx3a%5Cx3f%5D'
   23     6        ASSIGN                                                   !4, '%5B%5Cx21%5Cx24%5Cx26-%5Cx2c%5Cx3b%5Cx3d%5Cx40%5Cx5b%5Cx5d%5D'
   24     7        ASSIGN                                                   !5, '%5B%5Cx21%5Cx23%5Cx24%5Cx26-%5Cx2c%5Cx2f%5Cx3a%5Cx3b%5Cx3d%5Cx3f%5Cx40%5Cx5b%5Cx5d%5D'
   25     8        ROPE_INIT                                     3  ~46     '%28%3F%3A%5B%5Cx21%5Cx24%5Cx26-%5Cx2e%5Cx30-%5Cx3b%5Cx3d%5Cx40-%5Cx5a%5Cx5f%5Cx61-%5Cx7a%5Cx7e%5Cp%7BL%7D%5D%7C'
          9        ROPE_ADD                                      1  ~46     ~46, !1
         10        ROPE_END                                      2  ~45     ~46, '%29'
         11        ASSIGN                                                   !6, ~45
   34    12        NOP                                                      
         13        FAST_CONCAT                                      ~49     !6, '%2A'
         14        ASSIGN                                                   !7, ~49
   35    15        NOP                                                      
         16        FAST_CONCAT                                      ~51     !6, '%2B'
         17        ASSIGN                                                   !8, ~51
   36    18        ROPE_INIT                                     7  ~54     '%28%3F%3A'
         19        ROPE_ADD                                      1  ~54     ~54, !10
         20        ROPE_ADD                                      2  ~54     ~54, '%7C'
         21        ROPE_ADD                                      3  ~54     ~54, !1
         22        ROPE_ADD                                      4  ~54     ~54, '%7C'
         23        ROPE_ADD                                      5  ~54     ~54, !4
         24        ROPE_END                                      6  ~53     ~54, '%7C%5Cx40%29%2B'
         25        ASSIGN                                                   !9, ~53
   46    26        ROPE_INIT                                     3  ~60     '%28P%3CPath%3E%28%3F%3A%5Cx2f'
         27        ROPE_ADD                                      1  ~60     ~60, !7
         28        ROPE_END                                      2  ~59     ~60, '%29%2A%29'
         29        ASSIGN                                                   !11, ~59
   47    30        ROPE_INIT                                     5  ~64     '%28P%3CPath%3E%5Cx2f%28%3F%3A'
         31        ROPE_ADD                                      1  ~64     ~64, !7
         32        ROPE_ADD                                      2  ~64     ~64, '%28%3F%3A%5Cx2f'
         33        ROPE_ADD                                      3  ~64     ~64, !7
         34        ROPE_END                                      4  ~63     ~64, '%29%2A%29%3F%29'
         35        ASSIGN                                                   !12, ~63
   48    36        ROPE_INIT                                     5  ~69     '%28P%3CPath%3E'
         37        ROPE_ADD                                      1  ~69     ~69, !14
         38        ROPE_ADD                                      2  ~69     ~69, '%28%3F%3A%5Cx2f'
         39        ROPE_ADD                                      3  ~69     ~69, !7
         40        ROPE_END                                      4  ~68     ~69, '%29%2A%29'
         41        ASSIGN                                                   !13, ~68
   49    42        ROPE_INIT                                     5  ~74     '%28P%3CPath%3E'
         43        ROPE_ADD                                      1  ~74     ~74, !8
         44        ROPE_ADD                                      2  ~74     ~74, '%28%3F%3A%5Cx2f'
         45        ROPE_ADD                                      3  ~74     ~74, !7
         46        ROPE_END                                      4  ~73     ~74, '%29%2A%29'
         47        ASSIGN                                                   !15, ~73
   50    48        ASSIGN                                                   !16, '%28P%3CPath%3E%29'
   78    49        ASSIGN                                                   !17, '%28%3F%3A%5B0-9%5D%7C%5B1-9%5D%5B0-9%5D%7C1%5B0-9%5D%5B0-9%5D%7C2%5B0-4%5D%5B0-9%5D%7C25%5B0-5%5D'
   79    50        ROPE_INIT                                     9  ~81     '%28P%3CIPv4Address%3E'
         51        ROPE_ADD                                      1  ~81     ~81, !17
         52        ROPE_ADD                                      2  ~81     ~81, '%5Cx2e'
         53        ROPE_ADD                                      3  ~81     ~81, !17
         54        ROPE_ADD                                      4  ~81     ~81, '%5Cx2e'
         55        ROPE_ADD                                      5  ~81     ~81, !17
         56        ROPE_ADD                                      6  ~81     ~81, '%5Cx2e'
         57        ROPE_ADD                                      7  ~81     ~81, !17
         58        ROPE_END                                      8  ~80     ~81, '%29'
         59        ASSIGN                                                   !18, ~80
   81    60        ASSIGN                                                   !19, '%5B0-9A-Fa-f%5D%7B1%2C4%7D'
   82    61        ROPE_INIT                                     7  ~89     '%28%3F%3A'
         62        ROPE_ADD                                      1  ~89     ~89, !19
         63        ROPE_ADD                                      2  ~89     ~89, '%5Cx3a'
         64        ROPE_ADD                                      3  ~89     ~89, !19
         65        ROPE_ADD                                      4  ~89     ~89, '%7C'
         66        ROPE_ADD                                      5  ~89     ~89, !18
         67        ROPE_END                                      6  ~88     ~89, '%29'
         68        ASSIGN                                                   !20, ~88
   85    69        ROPE_INIT                                     5  ~95     '%28%3F%3A'
         70        ROPE_ADD                                      1  ~95     ~95, !19
         71        ROPE_ADD                                      2  ~95     ~95, '%5Cx3a%29%7B6%7D'
         72        ROPE_ADD                                      3  ~95     ~95, !20
         73        ROPE_END                                      4  ~94     ~95, '%7C'
         74        CONCAT                                           ~98     '%28P%3CIPv6Address%3E', ~94
   86    75        ROPE_INIT                                     5  ~100    '%5Cx3a%5Cx3a%28%3F%3A'
         76        ROPE_ADD                                      1  ~100    ~100, !19
         77        ROPE_ADD                                      2  ~100    ~100, '%5Cx3a%29%7B5%7D'
         78        ROPE_ADD                                      3  ~100    ~100, !20
         79        ROPE_END                                      4  ~99     ~100, '%7C'
         80        CONCAT                                           ~103    ~98, ~99
   87    81        ROPE_INIT                                     7  ~105    '%28%3F%3A'
         82        ROPE_ADD                                      1  ~105    ~105, !19
         83        ROPE_ADD                                      2  ~105    ~105, '%29%3F%5Cx3a%5Cx3a%28%3F%3A'
         84        ROPE_ADD                                      3  ~105    ~105, !19
         85        ROPE_ADD                                      4  ~105    ~105, '%5Cx3a%29%7B5%7D'
         86        ROPE_ADD                                      5  ~105    ~105, !20
         87        ROPE_END                                      6  ~104    ~105, '%7C'
         88        CONCAT                                           ~109    ~103, ~104
   88    89        ROPE_INIT                                     9  ~111    '%28%3F%3A%28%3F%3A'
         90        ROPE_ADD                                      1  ~111    ~111, !19
         91        ROPE_ADD                                      2  ~111    ~111, '%5Cx3a%29%7B%2C1%7D'
         92        ROPE_ADD                                      3  ~111    ~111, !19
         93        ROPE_ADD                                      4  ~111    ~111, '%29%3F%5Cx3a%5Cx3a%28%3F%3A'
         94        ROPE_ADD                                      5  ~111    ~111, !19
         95        ROPE_ADD                                      6  ~111    ~111, '%5Cx3a%29%7B3%7D'
         96        ROPE_ADD                                      7  ~111    ~111, !20
         97        ROPE_END                                      8  ~110    ~111, '%7C'
         98        CONCAT                                           ~116    ~109, ~110
   89    99        ROPE_INIT                                     9  ~118    '%28%3F%3A%28%3F%3A'
        100        ROPE_ADD                                      1  ~118    ~118, !19
        101        ROPE_ADD                                      2  ~118    ~118, '%5Cx3a%29%7B%2C2%7D'
        102        ROPE_ADD                                      3  ~118    ~118, !19
        103        ROPE_ADD                                      4  ~118    ~118, '%29%3F%5Cx3a%5Cx3a%28%3F%3A'
        104        ROPE_ADD                                      5  ~118    ~118, !19
        105        ROPE_ADD                                      6  ~118    ~118, '%5Cx3a%29%7B2%7D'
        106        ROPE_ADD                                      7  ~118    ~118, !20
        107        ROPE_END                                      8  ~117    ~118, '%7C'
        108        CONCAT                                           ~123    ~116, ~117
   90   109        ROPE_INIT                                     9  ~125    '%28%3F%3A%28%3F%3A'
        110        ROPE_ADD                                      1  ~125    ~125, !19
        111        ROPE_ADD                                      2  ~125    ~125, '%5Cx3a%29%7B%2C3%7D'
        112        ROPE_ADD                                      3  ~125    ~125, !19
        113        ROPE_ADD                                      4  ~125    ~125, '%29%3F%5Cx3a%5Cx3a%28%3F%3A'
        114        ROPE_ADD                                      5  ~125    ~125, !19
        115        ROPE_ADD                                      6  ~125    ~125, '%5Cx3a%29%7B1%7D'
        116        ROPE_ADD                                      7  ~125    ~125, !20
        117        ROPE_END                                      8  ~124    ~125, '%7C'
        118        CONCAT                                           ~130    ~123, ~124
   91   119        ROPE_INIT                                     7  ~132    '%28%3F%3A%28%3F%3A'
        120        ROPE_ADD                                      1  ~132    ~132, !19
        121        ROPE_ADD                                      2  ~132    ~132, '%5Cx3a%29%7B%2C4%7D'
        122        ROPE_ADD                                      3  ~132    ~132, !19
        123        ROPE_ADD                                      4  ~132    ~132, '%29%3F%5Cx3a%5Cx3a'
        124        ROPE_ADD                                      5  ~132    ~132, !20
        125        ROPE_END                                      6  ~131    ~132, '%7C'
        126        CONCAT                                           ~136    ~130, ~131
   92   127        ROPE_INIT                                     7  ~138    '%28%3F%3A%28%3F%3A'
        128        ROPE_ADD                                      1  ~138    ~138, !19
        129        ROPE_ADD                                      2  ~138    ~138, '%5Cx3a%29%7B%2C5%7D'
        130        ROPE_ADD                                      3  ~138    ~138, !19
        131        ROPE_ADD                                      4  ~138    ~138, '%29%3F%5Cx3a%5Cx3a'
        132        ROPE_ADD                                      5  ~138    ~138, !19
        133        ROPE_END                                      6  ~137    ~138, '%7C'
        134        CONCAT                                           ~142    ~136, ~137
   93   135        ROPE_INIT                                     5  ~144    '%28%3F%3A%28%3F%3A'
        136        ROPE_ADD                                      1  ~144    ~144, !19
        137        ROPE_ADD                                      2  ~144    ~144, '%5Cx3a%29%7B%2C6%7D'
        138        ROPE_ADD                                      3  ~144    ~144, !19
        139        ROPE_END                                      4  ~143    ~144, '%29%3F%5Cx3a%5Cx3a'
        140        CONCAT                                           ~147    ~142, ~143
   94   141        CONCAT                                           ~148    ~147, '%29'
   84   142        ASSIGN                                                   !21, ~148
   96   143        ROPE_INIT                                     5  ~151    'v%5B0-9A-Fa-f%5D%2B%5Cx2e%28%3F%3A'
        144        ROPE_ADD                                      1  ~151    ~151, !2
        145        ROPE_ADD                                      2  ~151    ~151, '%7C'
        146        ROPE_ADD                                      3  ~151    ~151, !4
        147        ROPE_END                                      4  ~150    ~151, '%7C%5Cx3a%29'
        148        ASSIGN                                                   !22, ~150
   98   149        ROPE_INIT                                     5  ~156    '%28%3F%3A%5Cx5b'
        150        ROPE_ADD                                      1  ~156    ~156, !21
        151        ROPE_ADD                                      2  ~156    ~156, '%7C'
        152        ROPE_ADD                                      3  ~156    ~156, !22
        153        ROPE_END                                      4  ~155    ~156, '%5Cx5d%29'
        154        ASSIGN                                                   !23, ~155
  104   155        ROPE_INIT                                     7  ~161    '%28%3F%3A'
        156        ROPE_ADD                                      1  ~161    ~161, !2
        157        ROPE_ADD                                      2  ~161    ~161, '%7C'
        158        ROPE_ADD                                      3  ~161    ~161, !1
        159        ROPE_ADD                                      4  ~161    ~161, '%7C'
        160        ROPE_ADD                                      5  ~161    ~161, !4
        161        ROPE_END                                      6  ~160    ~161, '%29%2A'
        162        ASSIGN                                                   !24, ~160
  113   163        ROPE_INIT                                     7  ~167    '%28P%3CUserinfo%3E%28%3F%3A'
        164        ROPE_ADD                                      1  ~167    ~167, !2
        165        ROPE_ADD                                      2  ~167    ~167, '%7C'
        166        ROPE_ADD                                      3  ~167    ~167, !1
        167        ROPE_ADD                                      4  ~167    ~167, '%7C'
        168        ROPE_ADD                                      5  ~167    ~167, !4
        169        ROPE_END                                      6  ~166    ~167, '%7C%5Cx3a%29%2A%29'
        170        ASSIGN                                                   !25, ~166
  114   171        ROPE_INIT                                     7  ~173    '%28P%3CHost%3E'
        172        ROPE_ADD                                      1  ~173    ~173, !24
        173        ROPE_ADD                                      2  ~173    ~173, '%7C'
        174        ROPE_ADD                                      3  ~173    ~173, !23
        175        ROPE_ADD                                      4  ~173    ~173, '%7C'
        176        ROPE_ADD                                      5  ~173    ~173, !18
        177        ROPE_END                                      6  ~172    ~173, '%29'
        178        ASSIGN                                                   !26, ~172
  115   179        ASSIGN                                                   !27, '%28P%3CPort%3E%5B0-9%5D%2A%29'
  116   180        ROPE_INIT                                     7  ~180    '%28%3F%3A'
        181        ROPE_ADD                                      1  ~180    ~180, !29
        182        ROPE_ADD                                      2  ~180    ~180, '%5Cx40%29%3F'
        183        ROPE_ADD                                      3  ~180    ~180, !26
        184        ROPE_ADD                                      4  ~180    ~180, '%28%3F%3A%5Cx3a'
        185        ROPE_ADD                                      5  ~180    ~180, !27
        186        ROPE_END                                      6  ~179    ~180, '%29%3F'
        187        ASSIGN                                                   !28, ~179
  133   188        ASSIGN                                                   !30, '%28P%3CScheme%3E%5BA-Za-z%5D%5B%5Cx2b%5Cx2d%5Cx2e0-9A-Za-z%5D%2A%29'
  134   189        ROPE_INIT                                    10  ~187    '%28%3F%3A%5Cx2f%5Cx2f'
        190        ROPE_ADD                                      1  ~187    ~187, !32
        191        ROPE_ADD                                      2  ~187    ~187, !33
        192        ROPE_ADD                                      3  ~187    ~187, '%7C'
        193        ROPE_ADD                                      4  ~187    ~187, !12
        194        ROPE_ADD                                      5  ~187    ~187, '%7C'
        195        ROPE_ADD                                      6  ~187    ~187, !15
        196        ROPE_ADD                                      7  ~187    ~187, '%7C'
        197        ROPE_ADD                                      8  ~187    ~187, !16
        198        ROPE_END                                      9  ~186    ~187, '%29'
        199        ASSIGN                                                   !31, ~186
  135   200        ROPE_INIT                                    10  ~194    '%28%3F%3A%5Cx2f%5Cx2f'
        201        ROPE_ADD                                      1  ~194    ~194, !32
        202        ROPE_ADD                                      2  ~194    ~194, !33
        203        ROPE_ADD                                      3  ~194    ~194, '%7C'
        204        ROPE_ADD                                      4  ~194    ~194, !12
        205        ROPE_ADD                                      5  ~194    ~194, '%7C'
        206        ROPE_ADD                                      6  ~194    ~194, !13
        207        ROPE_ADD                                      7  ~194    ~194, '%7C'
        208        ROPE_ADD                                      8  ~194    ~194, !16
        209        ROPE_END                                      9  ~193    ~194, '%29'
        210        ASSIGN                                                   !34, ~193
  136   211        ROPE_INIT                                     3  ~201    '%28P%3CQuery%3E%28%3F%3A'
        212        ROPE_ADD                                      1  ~201    ~201, !6
        213        ROPE_END                                      2  ~200    ~201, '%7C%2F%7C%3F%29%2A%29'
        214        ASSIGN                                                   !35, ~200
  137   215        ROPE_INIT                                     3  ~205    '%28P%3CFragment%3E%28%3F%3A'
        216        ROPE_ADD                                      1  ~205    ~205, !6
        217        ROPE_END                                      2  ~204    ~205, '%7C%2F%7C%3F%29%2A%29'
        218        ASSIGN                                                   !36, ~204
  147   219        ROPE_INIT                                     9  ~209    '%28%3F%3A'
        220        ROPE_ADD                                      1  ~209    ~209, !30
        221        ROPE_ADD                                      2  ~209    ~209, '%5Cx3a'
        222        ROPE_ADD                                      3  ~209    ~209, !31
        223        ROPE_ADD                                      4  ~209    ~209, '%28%3F%3A%5Cx3f'
        224        ROPE_ADD                                      5  ~209    ~209, !35
        225        ROPE_ADD                                      6  ~209    ~209, '%29%3F%28%3F%3A%5Cx23'
        226        ROPE_ADD                                      7  ~209    ~209, !36
        227        ROPE_END                                      8  ~208    ~209, '%29%3F'
        228        ASSIGN                                                   !37, ~208
  148   229        ROPE_INIT                                     6  ~216    !34
        230        ROPE_ADD                                      1  ~216    ~216, '%28%3F%3A%5Cx3f'
        231        ROPE_ADD                                      2  ~216    ~216, !35
        232        ROPE_ADD                                      3  ~216    ~216, '%29%3F%28%3F%3A%5Cx23'
        233        ROPE_ADD                                      4  ~216    ~216, !36
        234        ROPE_END                                      5  ~215    ~216, '%29%3F'
        235        ASSIGN                                                   !38, ~215
  149   236        ROPE_INIT                                     5  ~221    '%28P%3CURI%3E%3A'
        237        ROPE_ADD                                      1  ~221    ~221, !37
        238        ROPE_ADD                                      2  ~221    ~221, '%7C'
        239        ROPE_ADD                                      3  ~221    ~221, !38
        240        ROPE_END                                      4  ~220    ~221, '%29'
        241        ASSIGN                                                   !39, ~220
  151   242        ASSIGN                                           ~225    !0, !39
        243      > RETURN                                                   ~225
  152   244*     > RETURN                                                   null

End of function getregex

Function removedotsegments:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 87
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 36
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 65
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 46) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 76
Branch analysis from position: 75
2 jumps found. (Code = 46) Position 1 = 79, Position 2 = 80
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 82
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 85
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 85
Branch analysis from position: 82
Branch analysis from position: 80
Branch analysis from position: 76
Branch analysis from position: 74
Branch analysis from position: 65
2 jumps found. (Code = 46) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
Branch analysis from position: 74
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 36
Branch analysis from position: 53
Branch analysis from position: 36
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 36
Branch analysis from position: 53
Branch analysis from position: 36
Branch analysis from position: 50
Branch analysis from position: 87
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 87
Branch analysis from position: 10
Branch analysis from position: 87
filename:       /in/AfvpI
function name:  removeDotSegments
number of ops:  93
compiled vars:  !0 = $Path, !1 = $isRelative, !2 = $isAbsolute, !3 = $isTrailingSlash, !4 = $Segments, !5 = $up, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  170     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
  173     2        TYPE_CHECK                                   64          !0
          3      > JMPZ                                                     ~7, ->8
          4    >   ISSET_ISEMPTY_CV                                 ~8      !0
          5        BOOL_NOT                                         ~9      ~8
          6        QM_ASSIGN                                        ~10     ~9
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~10     <false>
          9    > > JMPZ                                                     ~10, ->87
  176    10    >   FETCH_DIM_R                                      ~11     !0, 0
         11        IS_EQUAL                                         ~12     ~11, '%2F'
         12        ASSIGN                                                   !2, ~12
  179    13        STRLEN                                           ~14     !0
         14        SUB                                              ~15     ~14, 1
         15        FETCH_DIM_R                                      ~16     !0, ~15
         16        IS_EQUAL                                         ~17     ~16, '%2F'
         17        ASSIGN                                                   !3, ~17
  182    18        INIT_FCALL                                               'array_values'
         19        INIT_FCALL                                               'array_filter'
         20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 '%2F'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $19     
         24        SEND_VAR                                                 $19
         25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAfvpI%3A182%240'
         26        SEND_VAL                                                 ~20
         27        DO_ICALL                                         $21     
         28        SEND_VAR                                                 $21
         29        DO_ICALL                                         $22     
         30        ASSIGN                                                   !4, $22
  185    31        ASSIGN                                                   !5, 0
         32        COUNT                                            ~25     !4
         33        SUB                                              ~26     ~25, 1
         34        ASSIGN                                                   !6, ~26
         35      > JMP                                                      ->51
  188    36    >   FETCH_DIM_R                                      ~28     !4, !6
         37        IS_EQUAL                                                 ~28, '.'
         38      > JMPZ                                                     ~29, ->41
  190    39    >   UNSET_DIM                                                !4, !6
         40      > JMP                                                      ->50
  194    41    >   FETCH_DIM_R                                      ~30     !4, !6
         42        IS_EQUAL                                                 ~30, '..'
         43      > JMPZ                              

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.48 ms | 1428 KiB | 19 Q