private function reconstitute($scheme, $authority, $path, $query, $fragment)
{
$result = '';
if ($scheme) {
$result .= $scheme . ':';
}
if ($authority) {
$result .= '//';
$result .= $authority;
}
$result .= $path;
if ($query) {
$result .= '?';
$result .= $query;
}
if ($fragment) {
$result .= '#';
$result .= $fragment;
}
return $result;
}