mirror of
https://github.com/php/php-src.git
synced 2024-10-10 03:02:13 +00:00
37 lines
446 B
PHP
37 lines
446 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @brief An empty Iterator
|
||
|
* @author Marcus Boerger
|
||
|
* @version 1.0
|
||
|
*
|
||
|
*/
|
||
|
class EmptyIterator implements Iterator
|
||
|
{
|
||
|
function rewind()
|
||
|
{
|
||
|
// nothing to do
|
||
|
}
|
||
|
|
||
|
function valid()
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
function current()
|
||
|
{
|
||
|
throw new Exception('Accessing the value of an EmptyIterator');
|
||
|
}
|
||
|
|
||
|
function key()
|
||
|
{
|
||
|
throw new Exception('Accessing the key of an EmptyIterator');
|
||
|
}
|
||
|
|
||
|
function next()
|
||
|
{
|
||
|
// nothing to do
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|