/** * Returns the current leaf. * * @return false|RecursiveLeafInterface Returns the current leaf on success, * false otherwise */ public function current() { if (is_null($this->current)) { $this->current = current($this->branch); } if ($this->current instanceof RecursiveLeafInterface) { return $this->current->current(); } return false; }