public function last()
    {
        if (empty($this->data)) {
            throw new OutOfBoundsException('Can\'t determine last item. Collection is empty');
        }

        $item = \end($this->data);
        \reset($this->data);

        return $item;
    }
public function last()
    {
        if (empty($this->data)) {
            throw new OutOfBoundsException('Can\'t determine last item. Collection is empty');
        }

        $item = \end($this->data);
        \reset($this->data);

        return $item;
    }
public function last ( ) { if ( empty ( $ this -> data ) ) { throw new OutOfBoundsException ( 'Can\'t determine last item. Collection is empty' ) ; } $ item = \ end ( $ this -> data ) ; \ reset ( $ this -> data ) ; return $ item ; }
Returns the last item of the collection.

@return mixed

@throws OutOfBoundsException when the collection is empty.
Returns the last item of the collection .