|
67 | 67 | *
|
68 | 68 | * - class ArrayObject implements IteratorAggregate
|
69 | 69 | * - class ArrayIterator implements Iterator
|
| 70 | + * - class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator |
70 | 71 | *
|
71 | 72 | * As the above suggest an ArrayObject creates an ArrayIterator when it comes to
|
72 | 73 | * iteration (e.g. ArrayObject instance used inside foreach).
|
@@ -511,17 +512,18 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Countable
|
511 | 512 | {
|
512 | 513 | /** Properties of the object have their normal functionality
|
513 | 514 | * when accessed as list (var_dump, foreach, etc.) */
|
514 |
| - const STD_PROP_LIST = 0x00000001; |
| 515 | + const STD_PROP_LIST = 0x00000001; |
515 | 516 | /** Array indices can be accessed as properties in read/write */
|
516 |
| - const ARRAY_AS_PROPS = 0x00000002; |
| 517 | + const ARRAY_AS_PROPS = 0x00000002; |
517 | 518 |
|
518 | 519 | /** Construct a new array iterator from anything that has a hash table.
|
519 | 520 | * That is any Array or Object.
|
520 | 521 | *
|
521 | 522 | * @param $array the array to use.
|
522 | 523 | * @param $flags see setFlags().
|
| 524 | + * @param $iterator_class class used in getIterator() |
523 | 525 | */
|
524 |
| - function __construct($array, $flags = 0); |
| 526 | + function __construct($array, $flags = 0, $iterator_class = "ArrayIterator"); |
525 | 527 |
|
526 | 528 | /** Set behavior flags.
|
527 | 529 | *
|
@@ -582,6 +584,14 @@ function getArrayCopy();
|
582 | 584 | * properties in the object.
|
583 | 585 | */
|
584 | 586 | function count();
|
| 587 | + |
| 588 | + /* @param $iterator_class new class used in getIterator() |
| 589 | + */ |
| 590 | + function setIteratorClass($itertor_class); |
| 591 | + |
| 592 | + /* @return class used in getIterator() |
| 593 | + */ |
| 594 | + function getIteratorClass(); |
585 | 595 | }
|
586 | 596 |
|
587 | 597 | /** @ingroup SPL
|
|
0 commit comments