class FixedArray implements ArrayAccess, IteratorAggregate

Class FixedArray fixed size array implements, and support string key.

SplFixedArray only allow int key.

Properties

protected array $keys
protected SplFixedArray $values

Methods

__construct(int $size = 0)

FixedArray constructor.

reset(int $size = 0)

reset

bool
__isset(string $key)

No description

__set(string $key, mixed $value)

No description

mixed
__get(string $key)

No description

int
getSize()

No description

int
getKeyIndex($key)

No description

array
getKeys()

No description

setKeys(array $keys)

No description

getValues()

No description

setValues(SplFixedArray $values)

No description

getIterator()

Defined by IteratorAggregate interface Returns an iterator for this object, for use with foreach

boolean
offsetExists(mixed $offset)

Checks whether an offset exists in the iterator.

mixed
offsetGet(mixed $offset)

Gets an offset in the iterator.

void
offsetSet(mixed $offset, mixed $value)

Sets an offset in the iterator.

void
offsetUnset(mixed $offset)

Unset an offset in the iterator.

Details

at line 36
__construct(int $size = 0)

FixedArray constructor.

Parameters

int $size

at line 46
reset(int $size = 0)

reset

Parameters

int $size

at line 56
bool __isset(string $key)

Parameters

string $key

Return Value

bool

at line 65
__set(string $key, mixed $value)

Parameters

string $key
mixed $value

at line 74
mixed __get(string $key)

Parameters

string $key

Return Value

mixed

at line 82
int getSize()

Return Value

int

at line 91
int getKeyIndex($key)

Parameters

$key

Return Value

int

at line 99
array getKeys()

Return Value

array

at line 107
setKeys(array $keys)

Parameters

array $keys

at line 115
SplFixedArray getValues()

Return Value

SplFixedArray

at line 123
setValues(SplFixedArray $values)

Parameters

SplFixedArray $values

at line 133
SplFixedArray getIterator()

Defined by IteratorAggregate interface Returns an iterator for this object, for use with foreach

Return Value

SplFixedArray

at line 143
boolean offsetExists(mixed $offset)

Checks whether an offset exists in the iterator.

Parameters

mixed $offset The array offset.

Return Value

boolean True if the offset exists, false otherwise.

at line 153
mixed offsetGet(mixed $offset)

Gets an offset in the iterator.

Parameters

mixed $offset The array offset.

Return Value

mixed The array value if it exists, null otherwise.

at line 170
void offsetSet(mixed $offset, mixed $value)

Sets an offset in the iterator.

Parameters

mixed $offset The array offset.
mixed $value The array value.

Return Value

void

at line 186
void offsetUnset(mixed $offset)

Unset an offset in the iterator.

Parameters

mixed $offset The array offset.

Return Value

void