public function last(): string
    {
        $this->rewind();
        $previousElement = $this->getCurrentElement();
        while ($this->valid()) {
            $previousElement = $this->getCurrentElement();
            $this->next();
        }
        return $previousElement->getValue();
    }
public function last(): string
    {
        $this->rewind();
        $previousElement = $this->getCurrentElement();
        while ($this->valid()) {
            $previousElement = $this->getCurrentElement();
            $this->next();
        }
        return $previousElement->getValue();
    }
public function last ( ) : string { $ this -> rewind ( ) ; $ previousElement = $ this -> getCurrentElement ( ) ; while ( $ this -> valid ( ) ) { $ previousElement = $ this -> getCurrentElement ( ) ; $ this -> next ( ) ; } return $ previousElement -> getValue ( ) ; }
Returns the last element of the iterator

@return string the last element of the iterator
Returns the last element of the iterator