public function withExtension($extension)
    {
        $clone = clone $this;
        $clone->info['extension'] = $extension;

        if (empty($clone->info['file'])) {
            $clone->info['file'] = array_pop($clone->info['path']);
        }

        return $clone;
    }
public function withExtension($extension)
    {
        $clone = clone $this;
        $clone->info['extension'] = $extension;

        if (empty($clone->info['file'])) {
            $clone->info['file'] = array_pop($clone->info['path']);
        }

        return $clone;
    }
public function withExtension ( $ extension ) { $ clone = clone $ this ; $ clone -> info [ 'extension' ] = $ extension ; if ( empty ( $ clone -> info [ 'file' ] ) ) { $ clone -> info [ 'file' ] = array_pop ( $ clone -> info [ 'path' ] ) ; } return $ clone ; }
Returns a clone with other extension.

@param string $extension

@return Url
Returns a clone with other extension .