public function removeLast()
    {
        if ($this->count() === 0) {
            throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.');
        }

        $tail = $this[$this->tail];

        unset($this[$this->tail]);
        $this->tail--;

        return $tail;
    }
public function removeLast()
    {
        if ($this->count() === 0) {
            throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.');
        }

        $tail = $this[$this->tail];

        unset($this[$this->tail]);
        $this->tail--;

        return $tail;
    }
public function removeLast ( ) { if ( $ this -> count ( ) === 0 ) { throw new NoSuchElementException ( 'Can\'t return element from Queue. Queue is empty.' ) ; } $ tail = $ this [ $ this -> tail ] ; unset ( $ this [ $ this -> tail ] ) ; $ this -> tail -- ; return $ tail ; }
Retrieves and removes the tail of this queue.

This method differs from `pollLast()` only in that it throws an exception
if this queue is empty.

@return mixed the tail of this queue.

@throws NoSuchElementException if this queue is empty.

@see self::pollLast()
Retrieves and removes the tail of this queue .