IPv6Address
extends Type
in package
Represents an IPv6 address
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Magic method for type coercion to string
- getShorts() : array<string|int, int>
- Get the address shorts
- getValue() : mixed
- Get the internal value
- setShorts() : mixed
- Set the address shorts
- setValue() : mixed
- Set the internal value
- createCompressedString() : string
- Create a compressed string representation of an IPv6 address
Properties
$value
protected
string
$value
= '::'
$shorts
private
array<string|int, int>
$shorts
= [0, 0, 0, 0, 0, 0, 0, 0]
The shorts of the address
Methods
__construct()
Constructor
public
__construct([string|array<string|int, int> $value = null ]) : mixed
Parameters
- $value : string|array<string|int, int> = null
-
String representation or shorts list
Tags
__toString()
Magic method for type coercion to string
public
__toString() : string
Return values
stringgetShorts()
Get the address shorts
public
getShorts() : array<string|int, int>
Return values
array<string|int, int>getValue()
Get the internal value
public
getValue() : mixed
setShorts()
Set the address shorts
public
setShorts(array<string|int, int> $shorts) : mixed
Parameters
- $shorts : array<string|int, int>
-
The new address shorts
Tags
setValue()
Set the internal value
public
setValue(string $value) : mixed
Parameters
- $value : string
-
The new value
Tags
createCompressedString()
Create a compressed string representation of an IPv6 address
private
createCompressedString(array<string|int, int> $shorts) : string
Parameters
- $shorts : array<string|int, int>
-
Address shorts