Iterator
class Iterator extends ArrayIterator (View source)
Constants
| STD_PROP_LIST |
|
| ARRAY_AS_PROPS |
|
Methods
__construct(TValue>|object $array = [], int $flags = 0, $iterator_class = null)
Construct an ArrayIterator
from
ArrayIterator
Details
__construct(TValue>|object $array = [], int $flags = 0, $iterator_class = null)
Construct an ArrayIterator
bool
offsetExists(TKey $key)
Check if offset exists
TValue
offsetGet(TKey $key)
Get value for an offset
void
offsetSet(TKey $key, TValue $value)
Set value for an offset
void
offsetUnset(TKey $key)
Unset value for an offset
void
append(TValue $value)
Append an element
TValue>
getArrayCopy()
Get array copy
int<0, max>
count()
Count elements
int
getFlags()
Get flags
void
setFlags(int $flags)
Set behaviour flags
asort(int $flags = SORT_REGULAR)
Sort array by values
ksort(int $flags = SORT_REGULAR)
Sort array by keys
uasort(TValue): int $callback)
User defined sort
uksort(TKey): int $callback)
User defined sort
natsort()
Sort an array naturally
natcasesort()
Sort an array naturally, case insensitive
void
unserialize(string $data)
Unserialize
string|null
serialize()
Serialize
void
rewind()
Rewind array back to the start
TValue
current()
Return current array entry
TKey|null
key()
Return current array key
void
next()
Move to next entry
bool
valid()
Check whether array contains more entries
void
seek(int $offset)
Seek to position
array
__debugInfo()
Since: 7.4
No description
array
__serialize()
Since: 7.4
No description
__unserialize(array $data)
Since: 7.4
No description