mirror of
https://github.com/php/php-src.git
synced 2024-10-10 11:12:08 +00:00
37 lines
446 B
PHP
Executable File
37 lines
446 B
PHP
Executable File
<?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
|
|
}
|
|
}
|
|
|
|
?>
|