/** * @param string $uri URI to be parsed */ public function __construct($uri) { // Hack, prevent infinite recursion if (!$uri instanceof AbstractSegment and 1 == func_num_args()) { $uri = static::createFromUrl($uri); parent::__construct($uri->getScheme(), $uri->getUser(), $uri->getPass(), $uri->getHost(), $uri->getPort(), $uri->getPath(), $uri->getQuery(), $uri->getFragment()); } else { call_user_func_array('parent::__construct', func_get_args()); } }