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
On this page
Latest version 2.0, released April 4, 2023. MIT license. Source repository
Packages on Packagist run on PHP. PHP end of life dates.
psr/http-message 2.0 breaking changes
- Signature changed
Interface methods now declare return types, so implementations must declare matching return types to remain compatible. github.com - Signature changed
Psr\Http\Message\MessageInterface::getBody
Was public function getBody(); now public function getBody(): StreamInterface. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::getHeader
Was public function getHeader(string $name); now public function getHeader(string $name): array. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::getHeaderLine
Was public function getHeaderLine(string $name); now public function getHeaderLine(string $name): string. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::getHeaders
Was public function getHeaders(); now public function getHeaders(): array. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::getProtocolVersion
Was public function getProtocolVersion(); now public function getProtocolVersion(): string. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::hasHeader
Was public function hasHeader(string $name); now public function hasHeader(string $name): bool. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::withAddedHeader
Was public function withAddedHeader(string $name, $value); now public function withAddedHeader(string $name, $value): MessageInterface. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::withBody
Was public function withBody(StreamInterface $body); now public function withBody(StreamInterface $body): MessageInterface. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::withHeader
Was public function withHeader(string $name, $value); now public function withHeader(string $name, $value): MessageInterface. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::withoutHeader
Was public function withoutHeader(string $name); now public function withoutHeader(string $name): MessageInterface. packagist.org - Signature changed
Psr\Http\Message\MessageInterface::withProtocolVersion
Was public function withProtocolVersion(string $version); now public function withProtocolVersion(string $version): MessageInterface. packagist.org - Signature changed
Psr\Http\Message\RequestInterface::getMethod
Was public function getMethod(); now public function getMethod(): string. packagist.org - Signature changed
Psr\Http\Message\RequestInterface::getRequestTarget
Was public function getRequestTarget(); now public function getRequestTarget(): string. packagist.org - Signature changed
Psr\Http\Message\RequestInterface::getUri
Was public function getUri(); now public function getUri(): UriInterface. packagist.org - Signature changed
Psr\Http\Message\RequestInterface::withMethod
Was public function withMethod(string $method); now public function withMethod(string $method): RequestInterface. packagist.org - Signature changed
Psr\Http\Message\RequestInterface::withRequestTarget
Was public function withRequestTarget(string $requestTarget); now public function withRequestTarget(string $requestTarget): RequestInterface. packagist.org - 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 - Signature changed
Psr\Http\Message\ResponseInterface::getReasonPhrase
Was public function getReasonPhrase(); now public function getReasonPhrase(): string. packagist.org - Signature changed
Psr\Http\Message\ResponseInterface::getStatusCode
Was public function getStatusCode(); now public function getStatusCode(): int. packagist.org - 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 - Signature changed
Psr\Http\Message\ServerRequestInterface::getAttributes
Was public function getAttributes(); now public function getAttributes(): array. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::getCookieParams
Was public function getCookieParams(); now public function getCookieParams(): array. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::getQueryParams
Was public function getQueryParams(); now public function getQueryParams(): array. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::getServerParams
Was public function getServerParams(); now public function getServerParams(): array. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::getUploadedFiles
Was public function getUploadedFiles(); now public function getUploadedFiles(): array. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withAttribute
Was public function withAttribute(string $name, $value); now public function withAttribute(string $name, $value): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withCookieParams
Was public function withCookieParams(array $cookies); now public function withCookieParams(array $cookies): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withoutAttribute
Was public function withoutAttribute(string $name); now public function withoutAttribute(string $name): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withParsedBody
Was public function withParsedBody($data); now public function withParsedBody($data): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withQueryParams
Was public function withQueryParams(array $query); now public function withQueryParams(array $query): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\ServerRequestInterface::withUploadedFiles
Was public function withUploadedFiles(array $uploadedFiles); now public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::__toString
Was public function __toString(); now public function __toString(): string. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::close
Was public function close(); now public function close(): void. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::eof
Was public function eof(); now public function eof(): bool. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::getContents
Was public function getContents(); now public function getContents(): string. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::getSize
Was public function getSize(); now public function getSize(): ?int. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::isReadable
Was public function isReadable(); now public function isReadable(): bool. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::isSeekable
Was public function isSeekable(); now public function isSeekable(): bool. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::isWritable
Was public function isWritable(); now public function isWritable(): bool. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::read
Was public function read(int $length); now public function read(int $length): string. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::rewind
Was public function rewind(); now public function rewind(): void. packagist.org - 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 - Signature changed
Psr\Http\Message\StreamInterface::tell
Was public function tell(); now public function tell(): int. packagist.org - Signature changed
Psr\Http\Message\StreamInterface::write
Was public function write(string $string); now public function write(string $string): int. packagist.org - Signature changed
Psr\Http\Message\UploadedFileInterface::getClientFilename
Was public function getClientFilename(); now public function getClientFilename(): ?string. packagist.org - Signature changed
Psr\Http\Message\UploadedFileInterface::getClientMediaType
Was public function getClientMediaType(); now public function getClientMediaType(): ?string. packagist.org - Signature changed
Psr\Http\Message\UploadedFileInterface::getError
Was public function getError(); now public function getError(): int. packagist.org - Signature changed
Psr\Http\Message\UploadedFileInterface::getSize
Was public function getSize(); now public function getSize(): ?int. packagist.org - Signature changed
Psr\Http\Message\UploadedFileInterface::getStream
Was public function getStream(); now public function getStream(): StreamInterface. packagist.org
And 17 more in this version. Sign up to see every change
Related packages
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The 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.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.