diff options
Diffstat (limited to 'ext/spl/spl.php')
| -rwxr-xr-x | ext/spl/spl.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/spl/spl.php b/ext/spl/spl.php index 6fb92b267d..4cf429d71c 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -169,6 +169,16 @@ class RecursiveIteratorIterator implements Iterator function getSubIterator([$level]); } +/** @ingroup SPL + * @brief This Interface allows to hook into the global count() function. + */ +interface Countable +{ + /** @return the number the global function count() should show + */ + function count(); +} + /** \ingroup SPL * \brief An Array wrapper * @@ -177,7 +187,7 @@ class RecursiveIteratorIterator implements Iterator * * \see ArrayIterator */ -class ArrayObject implements IteratorAggregate, ArrayAccess +class ArrayObject implements IteratorAggregate, ArrayAccess, Countable { /** Construct a new array iterator from anything that has a hash table. * That is any Array or Object. @@ -239,7 +249,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess * refer to it either by using foreach or by calling its getIterator() * method manually. */ -class ArrayIterator implements Iterator, SeekableIterator, ArrayAccess +class ArrayIterator implements Iterator, SeekableIterator, ArrayAccess, Countable { /** Construct a new array iterator from anything that has a hash table. * That is any Array or Object. |
