---
title: "psr/http-message 2.0 Breaking Changes on Packagist"
description: "What each psr/http-message release removed, renamed or changed: 67 breaking changes in 1 version on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/psr/http-message
last_updated: 2026-12-04
---

# psr/http-message breaking changes

psr/http-message 2.0 (April 4, 2023) is its newest release with breaking changes, 67 of them. The first: Adds return types to interface methods in psr/http-message 2.0. Every breaking API change we have recorded in psr/http-message on Packagist: 67 breaking changes in 1 version. Below, its one version with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `2.0`, released April 4, 2023. MIT license. [Source repository](https://github.com/php-fig/http-message)

Packages on Packagist run on PHP. [PHP end of life dates](https://since.dev/calendar/php.md).

## psr/http-message 2.0 breaking changes

psr/http-message 2.0, released April 4, 2023: 67 breaking changes.

- **Signature changed**  

Interface methods now declare return types, so implementations must declare matching return types to remain compatible. [github.com](https://github.com/php-fig/http-message/releases/tag/2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::getBody`  

Was public function getBody(); now public function getBody(): StreamInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::getHeader`  

Was public function getHeader(string $name); now public function getHeader(string $name): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::getHeaderLine`  

Was public function getHeaderLine(string $name); now public function getHeaderLine(string $name): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::getHeaders`  

Was public function getHeaders(); now public function getHeaders(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::getProtocolVersion`  

Was public function getProtocolVersion(); now public function getProtocolVersion(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::hasHeader`  

Was public function hasHeader(string $name); now public function hasHeader(string $name): bool. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::withAddedHeader`  

Was public function withAddedHeader(string $name, $value); now public function withAddedHeader(string $name, $value): MessageInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::withBody`  

Was public function withBody(StreamInterface $body); now public function withBody(StreamInterface $body): MessageInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::withHeader`  

Was public function withHeader(string $name, $value); now public function withHeader(string $name, $value): MessageInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::withoutHeader`  

Was public function withoutHeader(string $name); now public function withoutHeader(string $name): MessageInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\MessageInterface::withProtocolVersion`  

Was public function withProtocolVersion(string $version); now public function withProtocolVersion(string $version): MessageInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::getMethod`  

Was public function getMethod(); now public function getMethod(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::getRequestTarget`  

Was public function getRequestTarget(); now public function getRequestTarget(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::getUri`  

Was public function getUri(); now public function getUri(): UriInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::withMethod`  

Was public function withMethod(string $method); now public function withMethod(string $method): RequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::withRequestTarget`  

Was public function withRequestTarget(string $requestTarget); now public function withRequestTarget(string $requestTarget): RequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\RequestInterface::withUri`  

Was public function withUri(UriInterface $uri, bool $preserveHost = false); now public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ResponseInterface::getReasonPhrase`  

Was public function getReasonPhrase(); now public function getReasonPhrase(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ResponseInterface::getStatusCode`  

Was public function getStatusCode(); now public function getStatusCode(): int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ResponseInterface::withStatus`  

Was public function withStatus(int $code, string $reasonPhrase = ''); now public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::getAttributes`  

Was public function getAttributes(); now public function getAttributes(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::getCookieParams`  

Was public function getCookieParams(); now public function getCookieParams(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::getQueryParams`  

Was public function getQueryParams(); now public function getQueryParams(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::getServerParams`  

Was public function getServerParams(); now public function getServerParams(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::getUploadedFiles`  

Was public function getUploadedFiles(); now public function getUploadedFiles(): array. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withAttribute`  

Was public function withAttribute(string $name, $value); now public function withAttribute(string $name, $value): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withCookieParams`  

Was public function withCookieParams(array $cookies); now public function withCookieParams(array $cookies): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withoutAttribute`  

Was public function withoutAttribute(string $name); now public function withoutAttribute(string $name): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withParsedBody`  

Was public function withParsedBody($data); now public function withParsedBody($data): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withQueryParams`  

Was public function withQueryParams(array $query); now public function withQueryParams(array $query): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\ServerRequestInterface::withUploadedFiles`  

Was public function withUploadedFiles(array $uploadedFiles); now public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::__toString`  

Was public function \_\_toString(); now public function \_\_toString(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::close`  

Was public function close(); now public function close(): void. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::eof`  

Was public function eof(); now public function eof(): bool. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::getContents`  

Was public function getContents(); now public function getContents(): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::getSize`  

Was public function getSize(); now public function getSize(): ?int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::isReadable`  

Was public function isReadable(); now public function isReadable(): bool. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::isSeekable`  

Was public function isSeekable(); now public function isSeekable(): bool. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::isWritable`  

Was public function isWritable(); now public function isWritable(): bool. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::read`  

Was public function read(int $length); now public function read(int $length): string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::rewind`  

Was public function rewind(); now public function rewind(): void. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::seek`  

Was public function seek(int $offset, int $whence = SEEK_SET); now public function seek(int $offset, int $whence = SEEK_SET): void. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::tell`  

Was public function tell(); now public function tell(): int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\StreamInterface::write`  

Was public function write(string $string); now public function write(string $string): int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\UploadedFileInterface::getClientFilename`  

Was public function getClientFilename(); now public function getClientFilename(): ?string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\UploadedFileInterface::getClientMediaType`  

Was public function getClientMediaType(); now public function getClientMediaType(): ?string. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\UploadedFileInterface::getError`  

Was public function getError(); now public function getError(): int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\UploadedFileInterface::getSize`  

Was public function getSize(); now public function getSize(): ?int. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)
- **Signature changed** `Psr\Http\Message\UploadedFileInterface::getStream`  

Was public function getStream(); now public function getStream(): StreamInterface. [packagist.org](https://packagist.org/packages/psr/http-message#2.0)

And 17 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Related packages

- [psr/log](https://since.dev/packages/packagist/psr/log.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
