public function peek() { if ($this->_buffer) { return reset($this->_buffer); } if (!($next = $this->_fetch())) { return null; } $this->_buffer[] = $next; $first = reset($this->_buffer); return end($first); }