diff options
| author | Marcus Boerger <helly@php.net> | 2004-11-01 10:45:54 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-11-01 10:45:54 +0000 |
| commit | 8e3a8b1e8edb23613c5785d0ee2a3104c8a8d616 (patch) | |
| tree | 72fe8096732d19d824e3d6f8f76a4da2a27777bd /ext/spl/spl.php | |
| parent | b557bdb665a69748afb885b3d3d47523d9a0973e (diff) | |
| download | php-git-8e3a8b1e8edb23613c5785d0ee2a3104c8a8d616.tar.gz | |
- Add interface Countable (PECL #30113)
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. |
