Created
December 4, 2012 10:45
-
-
Save assertchris/4202584 to your computer and use it in GitHub Desktop.
ArrayIterator with ->previous()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArrayIterator extends \ArrayIterator | |
| { | |
| protected $_previous; | |
| public function next() | |
| { | |
| $this->_previous = $this->key(); | |
| parent::next(); | |
| } | |
| public function previous() | |
| { | |
| $this->seek($this->_previous); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment