Zend Uri Class

Code
<?php

use Zend\Uri\Uri;

$uri = new Uri('http://www.google.com/?q=zend');

$uri->setHost('bing.com');
echo 
$uri PHP_EOL;

$uri->setQuery(array('q' => 'php'));

if (
$uri->isValid()) {
    echo 
$uri;
}
Result
http://bing.com/?q=zend
http://bing.com/?q=php
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6