Inheritance diagram for ArrayIterator:


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 |
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.
Definition at line 727 of file spl.php.
| 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 741 of file spl.php.
| ArrayIterator::append | ( | $ | value | ) |
| $value | is appended as last element |
Definition at line 804 of file spl.php.
| ArrayIterator::asort | ( | ) |
| ArrayIterator::count | ( | ) |
| ArrayIterator::current | ( | ) |
Return the current element.
Implements Iterator.
Reimplemented in SubClasses.
Definition at line 829 of file spl.php.
Referenced by RecursiveArrayIterator::getChildren(), and RecursiveArrayIterator::hasChildren().
| ArrayIterator::getArrayCopy | ( | ) |
Definition at line 810 of file spl.php.
| ArrayIterator::key | ( | ) |
| ArrayIterator::natcasesort | ( | ) |
| ArrayIterator::natsort | ( | ) |
| ArrayIterator::next | ( | ) |
| ArrayIterator::offsetExists | ( | $ | index | ) |
| $index | offset to inspect |
Implements ArrayAccess.
Definition at line 784 of file spl.php.
| ArrayIterator::offsetGet | ( | $ | index | ) |
| $index | offset to return value for |
Implements ArrayAccess.
Definition at line 789 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 794 of file spl.php.
Referenced by SubClasses::__construct().
| ArrayIterator::offsetUnset | ( | $ | index | ) |
| ArrayIterator::rewind | ( | ) |
| ArrayIterator::seek | ( | $ | position | ) |
| $position | offset to seek to |
| OutOfBoundsException | if $position is invalid |
Implements SeekableIterator.
Definition at line 815 of file spl.php.
| ArrayIterator::setFlags | ( | $ | flags | ) |
| ArrayIterator::uasort | ( | mixed | cmp_function | ) |
| ArrayIterator::uksort | ( | mixed | cmp_function | ) |
| ArrayIterator::valid | ( | ) |
| const ArrayIterator::ARRAY_AS_PROPS = 0x00000002 |
| const ArrayIterator::STD_PROP_LIST = 0x00000001 |
1.5.2