3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Stdlib;
13 use ArrayObject as PhpArrayObject;
16 * ArrayObject that acts as a stack with regards to iteration
18 class ArrayStack extends PhpArrayObject
23 * Retrieve an array copy of the object, reverse its order, and return an
24 * ArrayIterator with that reversed array.
26 * @return ArrayIterator
28 public function getIterator()
30 $array = $this->getArrayCopy();
31 return new ArrayIterator(array_reverse($array));