Host
in package
implements
Stringable
Read onlyYes
FinalYes
Tags
Table of Contents
Interfaces
- Stringable
Properties
- $value : string
Methods
- __toString() : string
- equals() : bool
- isIp() : bool
- Returns true when the value is an IPv4 or IPv6 literal.
- isIpv6() : bool
- Returns true only when the value is an IPv6 literal.
- isLoopback() : bool
- Returns true when the host refers to the local machine only: the IPv4 loopback range 127.0.0.0/8, the IPv6 loopback `::1`, or the `localhost` hostname. Used to distinguish a development bind from a network-exposed one. Note `0.0.0.0` / `::` (all-interfaces) are NOT loopback — they expose the port on every interface.
- of() : self
- Create a Host from a string value.
Properties
$value
public
string
$value
Methods
__toString()
public
__toString() : string
Attributes
- #[Override]
Return values
stringequals()
public
equals(self $other) : bool
Parameters
- $other : self
Return values
boolisIp()
Returns true when the value is an IPv4 or IPv6 literal.
public
isIp() : bool
Return values
boolisIpv6()
Returns true only when the value is an IPv6 literal.
public
isIpv6() : bool
Return values
boolisLoopback()
Returns true when the host refers to the local machine only: the IPv4 loopback range 127.0.0.0/8, the IPv6 loopback `::1`, or the `localhost` hostname. Used to distinguish a development bind from a network-exposed one. Note `0.0.0.0` / `::` (all-interfaces) are NOT loopback — they expose the port on every interface.
public
isLoopback() : bool
Return values
boolof()
Create a Host from a string value.
public
static of(string $value) : self
Accepts IPv4 literals, IPv6 literals, and RFC 1123 hostnames.
Parameters
- $value : string