ramsey/collection breaking changes
ramsey/collection 2.0.0 (December 31, 2022) is its newest release with breaking changes, 73 of them. The first: ramsey/collection 2.0.0 requires PHP 8.1 or later. Every breaking API change we have recorded in ramsey/collection on Packagist: 73 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.1.1, released March 22, 2025. MIT license. Source repository
Its 2.0.0 release requires PHP 8.1 or later. PHP end of life dates.
ramsey/collection 2.0.0 breaking changes
- Removed
The package now requires PHP 8.1 or later. Upgrade PHP before using this release. github.com - Removed
ArrayInterface
ArrayInterface no longer extends the Serializable interface. Code relying on that inheritance must change. github.com - Removed
Ramsey\Collection\AbstractArray::serialize
AbstractArray no longer has serialize(). Implement __serialize() instead, which AbstractArray still supports. packagist.org - Removed
Ramsey\Collection\AbstractArray::unserialize
AbstractArray no longer has unserialize(). Implement __unserialize() instead, which AbstractArray still supports. packagist.org - Removed
Ramsey\Collection\CollectionInterface::SORT_ASC
Ramsey\Collection\CollectionInterface::SORT_ASC was removed in ramsey/collection 2.0.0 packagist.org - Removed
Ramsey\Collection\CollectionInterface::SORT_DESC
Ramsey\Collection\CollectionInterface::SORT_DESC was removed in ramsey/collection 2.0.0 packagist.org - Removed
Ramsey\Collection\Exception\InvalidSortOrderException
Ramsey\Collection\Exception\InvalidSortOrderException was removed in ramsey/collection 2.0.0 packagist.org - Removed
Ramsey\Collection\Exception\ValueExtractionException
Ramsey\Collection\Exception\ValueExtractionException was removed in ramsey/collection 2.0.0 packagist.org - Removed
Ramsey\Collection\Map\NamedParameterMap::$namedParameters
Ramsey\Collection\Map\NamedParameterMap::$namedParameters was removed in ramsey/collection 2.0.0 packagist.org - Removed
Ramsey\Collection\Queue::$index
Ramsey\Collection\Queue::$index was removed in ramsey/collection 2.0.0 packagist.org - Signature changed
Every method now has parameter and return type hints. Classes that extend or implement package types may need their method signatures updated. github.com - Signature changed
Ramsey\Collection\AbstractArray::offsetExists
Was public function offsetExists($offset): bool; now public function offsetExists(mixed $offset): bool. packagist.org - Signature changed
Ramsey\Collection\AbstractArray::offsetGet
Was public function offsetGet($offset); now public function offsetGet(mixed $offset): mixed. packagist.org - Signature changed
Ramsey\Collection\AbstractArray::offsetSet
Was public function offsetSet($offset, $value): void; now public function offsetSet(mixed $offset, mixed $value): void. packagist.org - Signature changed
Ramsey\Collection\AbstractArray::offsetUnset
Was public function offsetUnset($offset): void; now public function offsetUnset(mixed $offset): void. packagist.org - Signature changed
Ramsey\Collection\AbstractCollection::checkType
Was protected function checkType(string $type, $value): bool; now protected function checkType(string $type, mixed $value): bool. packagist.org - Signature changed
Ramsey\Collection\AbstractCollection::extractValue
Was protected function extractValue($object, string $propertyOrMethod); now protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed. packagist.org - Signature changed
Ramsey\Collection\AbstractCollection::sort
Was public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): CollectionInterface; now public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): CollectionInterface. packagist.org - Signature changed
Ramsey\Collection\AbstractCollection::toolValueToString
Was protected function toolValueToString($value): string; now protected function toolValueToString(mixed $value): string. packagist.org - Signature changed
Ramsey\Collection\AbstractCollection::where
Was public function where(string $propertyOrMethod, $value): CollectionInterface; now public function where(?string $propertyOrMethod, mixed $value): CollectionInterface. packagist.org - Signature changed
Ramsey\Collection\ArrayInterface
Was interface ArrayInterface extends ArrayAccess, Countable, IteratorAggregate, Serializable; now interface ArrayInterface extends ArrayAccess, Countable, IteratorAggregate. packagist.org - Signature changed
Ramsey\Collection\Collection::__construct
Was public function __construct(string $collectionType, array $data = []); now public function __construct(private readonly string $collectionType, array $data = []). packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::add
Was public function add($element): bool; now public function add(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::contains
Was public function contains($element, bool $strict = true): bool; now public function contains(mixed $element, bool $strict = true): bool. packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::first
Was public function first(); now public function first(): mixed. packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::last
Was public function last(); now public function last(): mixed. packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::remove
Was public function remove($element): bool; now public function remove(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::sort
Pass the Sort enum instead of a string as the second argument to sort(). packagist.org - Signature changed
Ramsey\Collection\CollectionInterface::where
Was public function where(string $propertyOrMethod, $value): self; now public function where(?string $propertyOrMethod, mixed $value): self. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::addFirst
Was public function addFirst($element): bool; now public function addFirst(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::addLast
Was public function addLast($element): bool; now public function addLast(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::firstElement
Was public function firstElement(); now public function firstElement(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::lastElement
Was public function lastElement(); now public function lastElement(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::offerFirst
Was public function offerFirst($element): bool; now public function offerFirst(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::offerLast
Was public function offerLast($element): bool; now public function offerLast(mixed $element): bool. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::peekFirst
Was public function peekFirst(); now public function peekFirst(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::peekLast
Was public function peekLast(); now public function peekLast(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::pollFirst
Was public function pollFirst(); now public function pollFirst(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::pollLast
Was public function pollLast(); now public function pollLast(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::removeFirst
Was public function removeFirst(); now public function removeFirst(): mixed. packagist.org - Signature changed
Ramsey\Collection\DoubleEndedQueueInterface::removeLast
Was public function removeLast(); now public function removeLast(): mixed. packagist.org - Signature changed
Ramsey\Collection\Exception\CollectionMismatchException
Was class CollectionMismatchException extends RuntimeException; now class CollectionMismatchException extends RuntimeException implements CollectionException. packagist.org - Signature changed
Ramsey\Collection\Exception\InvalidArgumentException
Was class InvalidArgumentException extends \InvalidArgumentException; now class InvalidArgumentException extends PhpInvalidArgumentException implements CollectionException. packagist.org - Signature changed
Ramsey\Collection\Exception\NoSuchElementException
Was class NoSuchElementException extends RuntimeException; now class NoSuchElementException extends RuntimeException implements CollectionException. packagist.org - Signature changed
Ramsey\Collection\Exception\OutOfBoundsException
Was class OutOfBoundsException extends \OutOfBoundsException; now class OutOfBoundsException extends PhpOutOfBoundsException implements CollectionException. packagist.org - Signature changed
Ramsey\Collection\Exception\UnsupportedOperationException
Was class UnsupportedOperationException extends RuntimeException; now class UnsupportedOperationException extends RuntimeException implements CollectionException. packagist.org - Signature changed
Ramsey\Collection\Map\AbstractTypedMap::checkType
Was protected function checkType(string $type, $value): bool; now protected function checkType(string $type, mixed $value): bool. packagist.org - Signature changed
Ramsey\Collection\Map\AbstractTypedMap::toolValueToString
Was protected function toolValueToString($value): string; now protected function toolValueToString(mixed $value): string. packagist.org - Signature changed
Ramsey\Collection\Map\MapInterface::containsKey
Was public function containsKey($key): bool; now public function containsKey(int | string $key): bool. packagist.org - Signature changed
Ramsey\Collection\Map\MapInterface::containsValue
Was public function containsValue($value): bool; now public function containsValue(mixed $value): bool. packagist.org
And 23 more in this version. Sign up to see every change
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.