public function dequeue() {
        if (null === $this->queue) return null;
        if ($this->tail > $this->head) return null;
        $item = $this->queue[$this->tail];
        $this->tail++;
        return $item;
    }