Pages

Wednesday, March 26, 2014

The KeyedTraversable interface



The KeyedTraversable<Tk, Tv> interface 
(HHVM >= 2.5)
Introduction 
Interface to detect if a class is traversable using foreach, of the form foreach($c => $k as $v).
Abstract base interface that cannot be implemented alone. Instead it must be implemented by KeyedIterator<Tk, Tv>.
Note:
Internal (built-in) classes that implement this interface can be used in a foreach construct and do not need to implement KeyedIterator<Tk, Tv>.
Note:
This is an internal engine interface which cannot be implemented in PHP scripts. KeyedIterator<Tk, Tv> must be used instead. When implementing an interface which extends KeyedTraversable<Tk, Tv>, make sure to listKeyedIterator<Tk, Tv> before its name in the implements clause.
Interface synopsis 
KeyedTraversable<Tk, Tv> extends Traversable<Tv> {
}
This interface has no methods, its only purpose is to be the base interface for all traversable<Tk, Tv> classes.

No comments:

Post a Comment