|
SPL-StandardPHPLibrary
|


Public Member Functions | |
| __construct ($array, $flags=0) | |
| append ($value) | |
| asort () | |
| count () | |
| current () | |
| getArrayCopy () | |
| getFlags () | |
| key () | |
| ksort () | |
| natcasesort () | |
| natsort () | |
| next () | |
| offsetExists ($index) | |
| offsetGet ($index) | |
| offsetSet ($index, $newval) | |
| offsetUnset ($index) | |
| rewind () | |
| seek ($position) | |
| setFlags ($flags) | |
| uasort (mixed cmp_function) | |
| uksort (mixed cmp_function) | |
| valid () | |
Public Attributes | |
| const | ARRAY_AS_PROPS = 0x00000002 |
| const | STD_PROP_LIST = 0x00000001 |
An Array iterator.
This iterator allows to unset and modify values and keys while iterating over Arrays and Objects.
When you want to iterate over the same array multiple times you need to instanciate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually.
| ArrayIterator::__construct | ( | $ | array, |
| $ | flags = 0 |
||
| ) |
Construct a new array iterator from anything that has a hash table.
That is any Array or Object.
| $array | the array to use. |
| $flags | see setFlags(). |
Reimplemented in SubClasses.
Definition at line 755 of file spl.php.
{}
| ArrayIterator::append | ( | $ | value | ) |
| $value | is appended as last element |
Definition at line 818 of file spl.php.
{}
| ArrayIterator::count | ( | ) |
| ArrayIterator::current | ( | ) |
Return the current element.
Implements Iterator.
Reimplemented in SubClasses.
Definition at line 843 of file spl.php.
Referenced by RecursiveArrayIterator\getChildren(), and RecursiveArrayIterator\hasChildren().
{}
| ArrayIterator::getArrayCopy | ( | ) |
Definition at line 824 of file spl.php.
{}
| ArrayIterator::key | ( | ) |
Return the key of the current element.
Implements Iterator.
Definition at line 846 of file spl.php.
Referenced by SubClasses\current().
{}
| ArrayIterator::natcasesort | ( | ) |
Sort the entries by values using case insensitive "natural order" algorithm.
Definition at line 793 of file spl.php.
Referenced by SubClasses\current().
{}
| ArrayIterator::natsort | ( | ) |
| ArrayIterator::next | ( | ) |
| ArrayIterator::offsetExists | ( | $ | index | ) |
| $index | offset to inspect |
Implements ArrayAccess.
Definition at line 798 of file spl.php.
{}
| ArrayIterator::offsetGet | ( | $ | index | ) |
| $index | offset to return value for |
Implements ArrayAccess.
Definition at line 803 of file spl.php.
{}
| ArrayIterator::offsetSet | ( | $ | index, |
| $ | newval | ||
| ) |
| $index | index to set |
| $newval | new value to store at offset $index |
Implements ArrayAccess.
Definition at line 808 of file spl.php.
Referenced by SubClasses\__construct().
{}
| ArrayIterator::offsetUnset | ( | $ | index | ) |
| $index | offset to unset |
Implements ArrayAccess.
Definition at line 812 of file spl.php.
{}
| ArrayIterator::rewind | ( | ) |
| ArrayIterator::seek | ( | $ | position | ) |
| $position | offset to seek to |
| OutOfBoundsException | if $position is invalid |
Implements SeekableIterator.
Definition at line 829 of file spl.php.
{}
| ArrayIterator::setFlags | ( | $ | flags | ) |
| ArrayIterator::uasort | ( | mixed | cmp_function | ) |
| ArrayIterator::uksort | ( | mixed | cmp_function | ) |
Sort the entries by key using user defined function.
Definition at line 785 of file spl.php.
Referenced by SubClasses\__construct().
{}
| ArrayIterator::valid | ( | ) |
| const ArrayIterator::ARRAY_AS_PROPS = 0x00000002 |
| const ArrayIterator::STD_PROP_LIST = 0x00000001 |
1.7.5.1