public function poll()
    {
        if ($this->count() === 0) {
            return null;
        }

        $head = $this[$this->index];

        unset($this[$this->index]);
        $this->index++;

        return $head;
    }
public function poll()
    {
        if ($this->count() === 0) {
            return null;
        }

        $head = $this[$this->index];

        unset($this[$this->index]);
        $this->index++;

        return $head;
    }
public function poll ( ) { if ( $ this -> count ( ) === 0 ) { return null ; } $ head = $ this [ $ this -> index ] ; unset ( $ this [ $ this -> index ] ) ; $ this -> index ++ ; return $ head ; }
Retrieves and removes the head of this queue, or returns `null`
if this queue is empty.

@return mixed|null the head of this queue, or `null` if this queue is empty.

@see self::remove()
Retrieves and removes the head of this queue or returns null if this queue is empty .