Documentation

IPv6Address extends Type
in package

Represents an IPv6 address

Tags
category

LibDNS

author

Chris Wright https://github.com/DaveRandom

Table of Contents

Properties

$value  : string
$shorts  : array<string|int, int>

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

$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
throws
UnexpectedValueException

When the supplied value is not a valid IPv6 address

__toString()

Magic method for type coercion to string

public __toString() : string
Return values
string

getShorts()

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
throws
UnexpectedValueException

When the supplied short list is not a valid IPv6 address

setValue()

Set the internal value

public setValue(string $value) : mixed
Parameters
$value : string

The new value

Tags
throws
UnexpectedValueException

When the supplied value is outside the valid length range 0 - 65535

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

Return values
string

        
On this page

Search results