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
On this page
Latest version 3.1.1, released November 23, 2026. MIT license. Source repository
Its 3.0.0 release requires PHP 8.4 or later. PHP end of life dates.
doctrine/collections 3.0.0 breaking changes
- Removed
Previously deprecated features were removed in this release, so code relying on them will break. github.com - Removed
accessRawFieldValues
The accessRawFieldValues parameter was removed; it was already a no-op, so callers should stop passing it. github.com - Removed
Doctrine\Common\Collections\Criteria::ASC
Use Order::Ascending instead. packagist.org - Removed
Doctrine\Common\Collections\Criteria::DESC
Use Order::Descending instead. packagist.org - Removed
Doctrine\Common\Collections\Criteria::getOrderings
Use orderings instead. packagist.org - Behavior changed
The package now requires PHP 8.4 or later; older PHP versions are no longer supported. github.com - Behavior changed
Classes are now marked final using the native PHP keyword, so code that extends them will break. github.com - Behavior changed
ReadableCollection
ReadableCollection now extends Selectable, so classes implementing it must also provide the Selectable methods. github.com - Signature changed
Return types were restored and missing types added across the codebase, which may break overrides with incompatible signatures. github.com - Signature changed
Types declared in doc-blocks are now native return type hints, which may break implementations with incompatible return types. github.com - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::count
Was public function count(); now public function count(): int. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::doInitialize
Was abstract protected function doInitialize(); now abstract protected function doInitialize(): void. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::filter
Was public function filter(Closure $p); now public function filter(Closure $p): Collection. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::getIterator
Was public function getIterator(); now public function getIterator(): Traversable. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::indexOf
Was public function indexOf(mixed $element); now public function indexOf(mixed $element): string|int|false. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::initialize
Was protected function initialize(); now protected function initialize(): void. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::isInitialized
Was public function isInitialized(); now public function isInitialized(): bool. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::key
Was public function key(); now public function key(): string|int|null. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::map
Was public function map(Closure $func); now public function map(Closure $func): Collection. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetExists
Was public function offsetExists(mixed $offset); now public function offsetExists(mixed $offset): bool. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetGet
Was public function offsetGet(mixed $offset); now public function offsetGet(mixed $offset): mixed. packagist.org - 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 - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetUnset
Was public function offsetUnset(mixed $offset); now public function offsetUnset(mixed $offset): void. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::__toString
Was public function __toString(); now public function __toString(): string. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::count
Was public function count(); now public function count(): int. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::createFrom
Was protected function createFrom(array $elements); now protected function createFrom(array $elements): static. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::filter
Was public function filter(Closure $p); now public function filter(Closure $p): Collection. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::getIterator
Was public function getIterator(); now public function getIterator(): Traversable. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::indexOf
Was public function indexOf($element); now public function indexOf(mixed $element): int|string|false. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::map
Was public function map(Closure $func); now public function map(Closure $func): Collection. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::matching
Was public function matching(Criteria $criteria); now public function matching(Criteria $criteria): Collection. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::offsetExists
Was public function offsetExists(mixed $offset); now public function offsetExists(mixed $offset): bool. packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection::offsetGet
Was public function offsetGet(mixed $offset); now public function offsetGet(mixed $offset): mixed. packagist.org - 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 - Signature changed
Doctrine\Common\Collections\ArrayCollection::offsetUnset
Was public function offsetUnset(mixed $offset); now public function offsetUnset(mixed $offset): void. packagist.org - 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 - Signature changed
Doctrine\Common\Collections\Collection::add
Was public function add(mixed $element); now public function add(mixed $element): void. packagist.org - Signature changed
Doctrine\Common\Collections\Collection::clear
Was public function clear(); now public function clear(): void. packagist.org - Signature changed
Doctrine\Common\Collections\Collection::remove
Was public function remove(string|int $key); now public function remove(string|int $key): mixed. packagist.org - Signature changed
Doctrine\Common\Collections\Collection::removeElement
Was public function removeElement(mixed $element); now public function removeElement(mixed $element): bool. packagist.org - 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 - Signature changed
Doctrine\Common\Collections\Criteria
Was class Criteria; now final class Criteria. packagist.org - 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 - Signature changed
Doctrine\Common\Collections\Criteria::andWhere
Was public function andWhere(Expression $expression); now public function andWhere(Expression $expression): static. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::create
Was public static function create(/* bool $accessRawFieldValues = false */): self; now public static function create(): static. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::expr
Was public static function expr(); now public static function expr(): ExpressionBuilder. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::getFirstResult
Was public function getFirstResult(); now public function getFirstResult(): int|null. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::getMaxResults
Was public function getMaxResults(); now public function getMaxResults(): int|null. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::getWhereExpression
Was public function getWhereExpression(); now public function getWhereExpression(): Expression|null. packagist.org - Signature changed
Doctrine\Common\Collections\Criteria::orderBy
Was public function orderBy(array $orderings); now public function orderBy(array $orderings): static. packagist.org
And 80 more in this version. Sign up to see every change
doctrine/collections 2.0.0 breaking changes
- Behavior changed
Collection.add
Collection::add() stopped returning true. Code that relies on its return value must be changed. github.com - Signature changed
Parameters and return values now use native PHP type declarations and strict types, so code passing mismatched types may fail. github.com - Signature changed
Some method parameters now have type declarations that were previously missing. github.com - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::$collection
Was protected $collection; now protected Collection|null $collection. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::$initialized
Was protected $initialized; now protected bool $initialized. packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetExists
Was public function offsetExists($offset); now public function offsetExists(mixed $offset). packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetGet
Was public function offsetGet($offset); now public function offsetGet(mixed $offset). packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetSet
Was public function offsetSet($offset, $value); now public function offsetSet(mixed $offset, mixed $value). packagist.org - Signature changed
Doctrine\Common\Collections\AbstractLazyCollection::offsetUnset
Was public function offsetUnset($offset); now public function offsetUnset(mixed $offset). packagist.org - Signature changed
Doctrine\Common\Collections\ArrayCollection
Was class ArrayCollection implements Collection, Selectable; now class ArrayCollection implements Collection, Selectable, Stringable. packagist.org
And 53 more in this version. Sign up to see every change
Related packages
- doctrine/annotations
- doctrine/coding-standard
- doctrine/dbal
- doctrine/doctrine-bundle
- doctrine/doctrine-fixtures-bundle
- doctrine/doctrine-migrations-bundle
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.