This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Zend Framework
4+ *
5+ * LICENSE
6+ *
7+ * This source file is subject to the new BSD license that is bundled
8+ * with this package in the file LICENSE.txt.
9+ * It is also available through the world-wide-web at this URL:
10+ * http://framework.zend.com/license/new-bsd
11+ * If you did not receive a copy of the license and are unable to
12+ * obtain it through the world-wide-web, please send an email
13+ * to license@zend.com so we can send you a copy immediately.
14+ *
15+ * @category Zend
16+ * @package Zend_Stdlib
17+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18+ * @license http://framework.zend.com/license/new-bsd New BSD License
19+ */
20+
21+ /**
22+ * @namespace
23+ */
24+ namespace Zend \Stdlib ;
25+
26+ use ArrayIterator ,
27+ ArrayObject ;
28+
29+ /**
30+ * ArrayObject that acts as a stack with regards to iteration
31+ *
32+ * @category Zend
33+ * @package Zend_Stdlib
34+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
35+ * @license http://framework.zend.com/license/new-bsd New BSD License
36+ */
37+ class ArrayStack extends ArrayObject
38+ {
39+ /**
40+ * Retrieve iterator
41+ *
42+ * Retrieve an array copy of the object, reverse its order, and return an
43+ * ArrayIterator with that reversed array.
44+ *
45+ * @return ArrayIterator
46+ */
47+ public function getIterator ()
48+ {
49+ $ array = $ this ->getArrayCopy ();
50+ return new ArrayIterator (array_reverse ($ array ));
51+ }
52+ }
You can’t perform that action at this time.
0 commit comments