Add public keyword, update sample code
use SPL built-in IteratorAggregate and ArrayIterator class