-
Notifications
You must be signed in to change notification settings - Fork 1
Uri: withPort Example
Terry L edited this page Jun 20, 2020
·
3 revisions
Shieldon\Psr7\Uri
Return an instance with the specified port.
-
param
int|null
port*
The port to use with the new instance; a null value removes the port information. -
return
static
Example:
echo $uri->getPort();
// Outputs: 8888
$uri = $uri->withPort(443);
echo $uri->getPort();
// Outputs: 443
$uri = $uri->withPort(null);
echo $uri->getPort();
// Outputs:
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.