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

# 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

Latest version `2.1.1`, released March 22, 2025. MIT license. [Source repository](https://github.com/ramsey/collection)

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

## ramsey/collection 2.0.0 breaking changes

ramsey/collection 2.0.0, released December 31, 2022: 73 breaking changes.

- **Removed**  

The package now requires PHP 8.1 or later. Upgrade PHP before using this release. [github.com](https://github.com/ramsey/collection/releases/tag/2.0.0)
- **Removed** `ArrayInterface`  

ArrayInterface no longer extends the Serializable interface. Code relying on that inheritance must change. [github.com](https://github.com/ramsey/collection/releases/tag/2.0.0)
- **Removed** `Ramsey\Collection\AbstractArray::serialize`  

AbstractArray no longer has serialize(). Implement \_\_serialize() instead, which AbstractArray still supports. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\AbstractArray::unserialize`  

AbstractArray no longer has unserialize(). Implement \_\_unserialize() instead, which AbstractArray still supports. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\CollectionInterface::SORT_ASC`  

Ramsey\\Collection\\CollectionInterface::SORT_ASC was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\CollectionInterface::SORT_DESC`  

Ramsey\\Collection\\CollectionInterface::SORT_DESC was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\Exception\InvalidSortOrderException`  

Ramsey\\Collection\\Exception\\InvalidSortOrderException was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\Exception\ValueExtractionException`  

Ramsey\\Collection\\Exception\\ValueExtractionException was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\Map\NamedParameterMap::$namedParameters`  

Ramsey\\Collection\\Map\\NamedParameterMap::$namedParameters was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Removed** `Ramsey\Collection\Queue::$index`  

Ramsey\\Collection\\Queue::$index was removed in ramsey/collection 2.0.0 [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://github.com/ramsey/collection/releases/tag/2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractArray::offsetExists`  

Was public function offsetExists($offset): bool; now public function offsetExists(mixed $offset): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractArray::offsetGet`  

Was public function offsetGet($offset); now public function offsetGet(mixed $offset): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractArray::offsetSet`  

Was public function offsetSet($offset, $value): void; now public function offsetSet(mixed $offset, mixed $value): void. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractArray::offsetUnset`  

Was public function offsetUnset($offset): void; now public function offsetUnset(mixed $offset): void. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractCollection::extractValue`  

Was protected function extractValue($object, string $propertyOrMethod); now protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\AbstractCollection::toolValueToString`  

Was protected function toolValueToString($value): string; now protected function toolValueToString(mixed $value): string. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\ArrayInterface`  

Was interface ArrayInterface extends ArrayAccess, Countable, IteratorAggregate, Serializable; now interface ArrayInterface extends ArrayAccess, Countable, IteratorAggregate. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\CollectionInterface::add`  

Was public function add($element): bool; now public function add(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\CollectionInterface::first`  

Was public function first(); now public function first(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\CollectionInterface::last`  

Was public function last(); now public function last(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\CollectionInterface::remove`  

Was public function remove($element): bool; now public function remove(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\CollectionInterface::sort`  

Pass the Sort enum instead of a string as the second argument to sort(). [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::addFirst`  

Was public function addFirst($element): bool; now public function addFirst(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::addLast`  

Was public function addLast($element): bool; now public function addLast(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::firstElement`  

Was public function firstElement(); now public function firstElement(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::lastElement`  

Was public function lastElement(); now public function lastElement(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::offerFirst`  

Was public function offerFirst($element): bool; now public function offerFirst(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::offerLast`  

Was public function offerLast($element): bool; now public function offerLast(mixed $element): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::peekFirst`  

Was public function peekFirst(); now public function peekFirst(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::peekLast`  

Was public function peekLast(); now public function peekLast(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::pollFirst`  

Was public function pollFirst(); now public function pollFirst(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::pollLast`  

Was public function pollLast(); now public function pollLast(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::removeFirst`  

Was public function removeFirst(); now public function removeFirst(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\DoubleEndedQueueInterface::removeLast`  

Was public function removeLast(); now public function removeLast(): mixed. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Exception\CollectionMismatchException`  

Was class CollectionMismatchException extends RuntimeException; now class CollectionMismatchException extends RuntimeException implements CollectionException. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Exception\InvalidArgumentException`  

Was class InvalidArgumentException extends \\InvalidArgumentException; now class InvalidArgumentException extends PhpInvalidArgumentException implements CollectionException. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Exception\NoSuchElementException`  

Was class NoSuchElementException extends RuntimeException; now class NoSuchElementException extends RuntimeException implements CollectionException. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Exception\OutOfBoundsException`  

Was class OutOfBoundsException extends \\OutOfBoundsException; now class OutOfBoundsException extends PhpOutOfBoundsException implements CollectionException. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Exception\UnsupportedOperationException`  

Was class UnsupportedOperationException extends RuntimeException; now class UnsupportedOperationException extends RuntimeException implements CollectionException. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **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](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Map\AbstractTypedMap::toolValueToString`  

Was protected function toolValueToString($value): string; now protected function toolValueToString(mixed $value): string. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Map\MapInterface::containsKey`  

Was public function containsKey($key): bool; now public function containsKey(int | string $key): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)
- **Signature changed** `Ramsey\Collection\Map\MapInterface::containsValue`  

Was public function containsValue($value): bool; now public function containsValue(mixed $value): bool. [packagist.org](https://packagist.org/packages/ramsey/collection#2.0.0)

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

## 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.
