public function next() { $prev = key($this->_data); $this->_valid = next($this->_data) !== false; $cur = key($this->_data); if (isset($this->_removed[$cur])) { return $this->next(); } if (!$this->_valid && $cur !== $prev && $cur !== null) { $this->_valid = true; } return $this->_valid ? $this->__get(key($this->_data)) : null; }