---
title: "doctrine/collections 3.0.0 Breaking Changes on Packagist"
description: "What each doctrine/collections release removed, renamed or changed: 193 breaking changes in 2 versions on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/doctrine/collections
last_updated: 2026-12-04
---

# doctrine/collections breaking changes

doctrine/collections 3.0.0 (January 19, 2026) is its newest release with breaking changes, 130 of them. The first: Deprecated features cleaned up in doctrine/collections 3.0.0. Every breaking API change we have recorded in doctrine/collections on Packagist: 193 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `3.1.1`, released November 23, 2026. MIT license. [Source repository](https://github.com/doctrine/collections)

Its 3.0.0 release requires [PHP 8.4](https://since.dev/calendar/php/8.4.md) or later. [PHP end of life dates](https://since.dev/calendar/php.md).

- From [2.0.0](#v-2-0-0) to [3.0.0](#v-3-0-0): 130 breaking changes in 1 version.

## doctrine/collections 3.0.0 breaking changes

doctrine/collections 3.0.0, released January 19, 2026: 130 breaking changes.

- **Removed**  

Previously deprecated features were removed in this release, so code relying on them will break. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Removed** `accessRawFieldValues`  

The accessRawFieldValues parameter was removed; it was already a no-op, so callers should stop passing it. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Removed** `Doctrine\Common\Collections\Criteria::ASC`  

Use Order::Ascending instead. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Removed** `Doctrine\Common\Collections\Criteria::DESC`  

Use Order::Descending instead. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Removed** `Doctrine\Common\Collections\Criteria::getOrderings`  

Use orderings instead. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Behavior changed**  

The package now requires PHP 8.4 or later; older PHP versions are no longer supported. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Behavior changed**  

Classes are now marked final using the native PHP keyword, so code that extends them will break. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Behavior changed** `ReadableCollection`  

ReadableCollection now extends Selectable, so classes implementing it must also provide the Selectable methods. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Signature changed**  

Return types were restored and missing types added across the codebase, which may break overrides with incompatible signatures. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Signature changed**  

Types declared in doc-blocks are now native return type hints, which may break implementations with incompatible return types. [github.com](https://github.com/doctrine/collections/releases/tag/3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::count`  

Was public function count(); now public function count(): int. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::doInitialize`  

Was abstract protected function doInitialize(); now abstract protected function doInitialize(): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::filter`  

Was public function filter(Closure $p); now public function filter(Closure $p): Collection. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::getIterator`  

Was public function getIterator(); now public function getIterator(): Traversable. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::indexOf`  

Was public function indexOf(mixed $element); now public function indexOf(mixed $element): string|int|false. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::initialize`  

Was protected function initialize(); now protected function initialize(): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::isInitialized`  

Was public function isInitialized(); now public function isInitialized(): bool. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::key`  

Was public function key(); now public function key(): string|int|null. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::map`  

Was public function map(Closure $func); now public function map(Closure $func): Collection. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetExists`  

Was public function offsetExists(mixed $offset); now public function offsetExists(mixed $offset): bool. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetGet`  

Was public function offsetGet(mixed $offset); now public function offsetGet(mixed $offset): mixed. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetSet`  

Was public function offsetSet(mixed $offset, mixed $value); now public function offsetSet(mixed $offset, mixed $value): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetUnset`  

Was public function offsetUnset(mixed $offset); now public function offsetUnset(mixed $offset): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::__toString`  

Was public function \_\_toString(); now public function \_\_toString(): string. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::count`  

Was public function count(); now public function count(): int. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::createFrom`  

Was protected function createFrom(array $elements); now protected function createFrom(array $elements): static. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::filter`  

Was public function filter(Closure $p); now public function filter(Closure $p): Collection. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::getIterator`  

Was public function getIterator(); now public function getIterator(): Traversable. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::indexOf`  

Was public function indexOf($element); now public function indexOf(mixed $element): int|string|false. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::map`  

Was public function map(Closure $func); now public function map(Closure $func): Collection. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::matching`  

Was public function matching(Criteria $criteria); now public function matching(Criteria $criteria): Collection. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::offsetExists`  

Was public function offsetExists(mixed $offset); now public function offsetExists(mixed $offset): bool. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::offsetGet`  

Was public function offsetGet(mixed $offset); now public function offsetGet(mixed $offset): mixed. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::offsetSet`  

Was public function offsetSet(mixed $offset, mixed $value); now public function offsetSet(mixed $offset, mixed $value): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::offsetUnset`  

Was public function offsetUnset(mixed $offset); now public function offsetUnset(mixed $offset): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection::reduce`  

Was public function reduce(Closure $func, $initial = null); now public function reduce(Closure $func, mixed $initial = null): mixed. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Collection::add`  

Was public function add(mixed $element); now public function add(mixed $element): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Collection::clear`  

Was public function clear(); now public function clear(): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Collection::remove`  

Was public function remove(string|int $key); now public function remove(string|int $key): mixed. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Collection::removeElement`  

Was public function removeElement(mixed $element); now public function removeElement(mixed $element): bool. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Collection::set`  

Was public function set(string|int $key, mixed $value); now public function set(string|int $key, mixed $value): void. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria`  

Was class Criteria; now final class Criteria. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::__construct`  

Was public function \_\_construct(private Expression|null $expression = null, array|null $orderings = null, int|Placeholder|null $firstResult = Placeholder::NotSpecified, int|null $maxResults = null, private bool $accessRawFieldValues =... [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::andWhere`  

Was public function andWhere(Expression $expression); now public function andWhere(Expression $expression): static. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::create`  

Was public static function create(/\* bool $accessRawFieldValues = false \*/): self; now public static function create(): static. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::expr`  

Was public static function expr(); now public static function expr(): ExpressionBuilder. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::getFirstResult`  

Was public function getFirstResult(); now public function getFirstResult(): int|null. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::getMaxResults`  

Was public function getMaxResults(); now public function getMaxResults(): int|null. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::getWhereExpression`  

Was public function getWhereExpression(); now public function getWhereExpression(): Expression|null. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)
- **Signature changed** `Doctrine\Common\Collections\Criteria::orderBy`  

Was public function orderBy(array $orderings); now public function orderBy(array $orderings): static. [packagist.org](https://packagist.org/packages/doctrine/collections#3.0.0)

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

## doctrine/collections 2.0.0 breaking changes

doctrine/collections 2.0.0, released September 29, 2022: 63 breaking changes.

- **Behavior changed** `Collection.add`  

Collection::add() stopped returning true. Code that relies on its return value must be changed. [github.com](https://github.com/doctrine/collections/releases/tag/2.0.0)
- **Signature changed**  

Parameters and return values now use native PHP type declarations and strict types, so code passing mismatched types may fail. [github.com](https://github.com/doctrine/collections/releases/tag/2.0.0)
- **Signature changed**  

Some method parameters now have type declarations that were previously missing. [github.com](https://github.com/doctrine/collections/releases/tag/2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::$collection`  

Was protected $collection; now protected Collection|null $collection. [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::$initialized`  

Was protected $initialized; now protected bool $initialized. [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetExists`  

Was public function offsetExists($offset); now public function offsetExists(mixed $offset). [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetGet`  

Was public function offsetGet($offset); now public function offsetGet(mixed $offset). [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetSet`  

Was public function offsetSet($offset, $value); now public function offsetSet(mixed $offset, mixed $value). [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\AbstractLazyCollection::offsetUnset`  

Was public function offsetUnset($offset); now public function offsetUnset(mixed $offset). [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)
- **Signature changed** `Doctrine\Common\Collections\ArrayCollection`  

Was class ArrayCollection implements Collection, Selectable; now class ArrayCollection implements Collection, Selectable, Stringable. [packagist.org](https://packagist.org/packages/doctrine/collections#2.0.0)

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

## Related packages

- [doctrine/annotations](https://since.dev/packages/packagist/doctrine/annotations.md)
- [doctrine/coding-standard](https://since.dev/packages/packagist/doctrine/coding-standard.md)
- [doctrine/dbal](https://since.dev/packages/packagist/doctrine/dbal.md)
- [doctrine/doctrine-bundle](https://since.dev/packages/packagist/doctrine/doctrine-bundle.md)
- [doctrine/doctrine-fixtures-bundle](https://since.dev/packages/packagist/doctrine/doctrine-fixtures-bundle.md)
- [doctrine/doctrine-migrations-bundle](https://since.dev/packages/packagist/doctrine/doctrine-migrations-bundle.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.
