Documentation

IPv4Address extends Type
in package

Represents an IPv4 address

Tags
category

LibDNS

author

Chris Wright https://github.com/DaveRandom

Table of Contents

Properties

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

Methods

__construct()  : mixed
Constructor
__toString()  : string
Magic method for type coercion to string
getOctets()  : array<string|int, int>
Get the address octets
getValue()  : mixed
Get the internal value
setOctets()  : mixed
Set the address octets
setValue()  : mixed
Set the internal value

Properties

$octets

private array<string|int, int> $octets = [0, 0, 0, 0]

The octets 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 octet list

Tags
throws
UnexpectedValueException

When the supplied value is not a valid IPv4 address

__toString()

Magic method for type coercion to string

public __toString() : string
Return values
string

getOctets()

Get the address octets

public getOctets() : array<string|int, int>
Return values
array<string|int, int>

getValue()

Get the internal value

public getValue() : mixed

setOctets()

Set the address octets

public setOctets(array<string|int, int> $octets) : mixed
Parameters
$octets : array<string|int, int>

The new address octets

Tags
throws
UnexpectedValueException

When the supplied octet list is not a valid IPv4 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


        
On this page

Search results