根据http://php.net/manual/en/class.outeriterator.php,接口OuterIterator声明如下:
OuterIterator extends Iterator {
/* Methods */
public Iterator getInnerIterator ( void )
/* Inherited methods */
abstract public mixed Iterator::current ( void )
abstract public scalar Iterator::key ( void )
abstract public void Iterator::next ( void )
abstract public void Iterator::rewind ( void )
abstract public boolean Iterator::valid ( void )
}
在PHP中,接口方法不能包含实现。那么为什么这些方法在OuterIterator接口中被声明为abstract?为什么getInnerIterator没有声明为abstract?