public function getIterator() { for ($stack = $this; !$stack->isEmpty();) { (yield $stack->peek()); $stack = $stack->pop(); } }