SplFixedArray
class SplFixedArray implements Iterator, ArrayAccess, Countable, IteratorAggregate, JsonSerializable (View source)
Methods
Constructs a new fixed array
Returns the size of the array
Returns a PHP array from the fixed array
Import a PHP array in a SplFixedArray instance
Gets the size of the array
Change the size of an array
Returns whether the requested index exists
Returns the value at the specified index
Sets a new value at a specified index
Unsets the value at the specified $index
Rewind iterator back to the start
Return current array entry
Return current array index
Move to next entry
Check whether the array contains more elements
No description
No description
No description
No description
Specify data which should be serialized to JSON
Details
__construct(int $size = 0)
Constructs a new fixed array
int
count()
Returns the size of the array
array
toArray()
Returns a PHP array from the fixed array
static SplFixedArray
fromArray(array $array, bool $preserveKeys = true)
Import a PHP array in a SplFixedArray instance
int
getSize()
Gets the size of the array
bool
setSize(int $size)
Change the size of an array
bool
offsetExists(int $index)
Returns whether the requested index exists
mixed
offsetGet(int $index)
Returns the value at the specified index
void
offsetSet(int $index, TValue $value)
Sets a new value at a specified index
void
offsetUnset(int $index)
Unsets the value at the specified $index
void
rewind()
Rewind iterator back to the start
mixed
current()
Return current array entry
mixed
key()
Return current array index
void
next()
Move to next entry
bool
valid()
Check whether the array contains more elements
void
__wakeup()
No description
array
__serialize()
No description
void
__unserialize(array $data)
No description
Traversable
getIterator()
No description
mixed
jsonSerialize()
Specify data which should be serialized to JSON