Zend\Diactoros\MessageTrait::withoutHeader PHP Method

withoutHeader() public method

Header resolution MUST be done without case-sensitivity. This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that removes the named header.
public withoutHeader ( string $header ) : static
$header string Case-insensitive header field name to remove.
return static
    public function withoutHeader($header)
    {
        if (!$this->hasHeader($header)) {
            return clone $this;
        }
        $normalized = strtolower($header);
        $original = $this->headerNames[$normalized];
        $new = clone $this;
        unset($new->headers[$original], $new->headerNames[$normalized]);
        return $new;
    }