**Symfony version(s) affected**: Latest build **Description** Symfony/Component/HttpFoundation/HeaderBag.php The "get" function produces an "Undefined offset: 0" error if $headers is returned by the "all" function as an empty array. If "all" is called and a key cannot be found in $this->headers, then [] is returned. However, this breaks line 116: if (null === $headers[0]) { **How to reproduce** Call the get() function with a key that doesn't exist in the headers. **Possible Solution** Update line 112 from: if (!$headers) { to if (!$headers || !isset($headers[0])) { **Additional context** <!-- Optional: any other context about the problem: log messages, screenshots, etc. -->