original_string: private static function isValidUriPath(string $path): bool
      {
          // http://tools.ietf.org/html/rfc3986#section-3
          // The scheme and path components are required, though the path may be
          // empty (no characters)
          if ($path === '') {
              return true;
          }
  
          // path          = path-abempty    ; begins with "/" or is empty
          //               / path-absolute   ; begins with "/" but not "//"
          //               / path-noscheme   ; begins with a non-colon segment
          //               / path-rootless   ; begins with a segment
          //               / path-empty      ; zero characters
          //
          // path-abempty  = *( "/" segment )
          // path-absolute = "/" [ segment-nz *( "/" segment ) ]
          // path-noscheme = segment-nz-nc *( "/" segment )
          // path-rootless = segment-nz *( "/" segment )
          // path-empty    = 0<pchar>
          // segment       = *pchar
          // segment-nz    = 1*pchar
          // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
          //               ; non-zero-length segment without any colon ":"
          // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
          $pattern = sprintf(
              '/\A(?:(?:[%s%s:@]|(?:%s))*\/?)*\z/i',
              'a-z0-9\-._~',
              '!$&\'()*+,;=',
              '%[a-f0-9]{2}'
          );
  
          return !!preg_match($pattern, $path);
      }
code: private static function isValidUriPath(string $path): bool
      {
          // http://tools.ietf.org/html/rfc3986#section-3
          // The scheme and path components are required, though the path may be
          // empty (no characters)
          if ($path === '') {
              return true;
          }
  
          // path          = path-abempty    ; begins with "/" or is empty
          //               / path-absolute   ; begins with "/" but not "//"
          //               / path-noscheme   ; begins with a non-colon segment
          //               / path-rootless   ; begins with a segment
          //               / path-empty      ; zero characters
          //
          // path-abempty  = *( "/" segment )
          // path-absolute = "/" [ segment-nz *( "/" segment ) ]
          // path-noscheme = segment-nz-nc *( "/" segment )
          // path-rootless = segment-nz *( "/" segment )
          // path-empty    = 0<pchar>
          // segment       = *pchar
          // segment-nz    = 1*pchar
          // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
          //               ; non-zero-length segment without any colon ":"
          // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
          $pattern = sprintf(
              '/\A(?:(?:[%s%s:@]|(?:%s))*\/?)*\z/i',
              'a-z0-9\-._~',
              '!$&\'()*+,;=',
              '%[a-f0-9]{2}'
          );
  
          return !!preg_match($pattern, $path);
      }
code_tokens: private static function isValidUriPath ( string $ path ) : bool { // http://tools.ietf.org/html/rfc3986#section-3 // The scheme and path components are required, though the path may be // empty (no characters) if ( $ path === '' ) { return true ; } // path          = path-abempty    ; begins with "/" or is empty //               / path-absolute   ; begins with "/" but not "//" //               / path-noscheme   ; begins with a non-colon segment //               / path-rootless   ; begins with a segment //               / path-empty      ; zero characters // // path-abempty  = *( "/" segment ) // path-absolute = "/" [ segment-nz *( "/" segment ) ] // path-noscheme = segment-nz-nc *( "/" segment ) // path-rootless = segment-nz *( "/" segment ) // path-empty    = 0<pchar> // segment       = *pchar // segment-nz    = 1*pchar // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) //               ; non-zero-length segment without any colon ":" // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@" $ pattern = sprintf ( '/\A(?:(?:[%s%s:@]|(?:%s))*\/?)*\z/i' , 'a-z0-9\-._~' , '!$&\'()*+,;=' , '%[a-f0-9]{2}' ) ; return ! ! preg_match ( $ pattern , $ path ) ; }
docstring: Checks if a URI path is valid
  
  @param string $path The URI path
  
  @return bool
docstring_tokens: Checks if a URI path is valid