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

# hamcrest/hamcrest-php breaking changes

hamcrest/hamcrest-php v3.0.0 (June 16, 2026) is its newest release with breaking changes, 329 of them. The first: Removed Hamcrest\\Core\\DescribedAs::ARG_PATTERN. Every breaking API change we have recorded in hamcrest/hamcrest-php on Packagist: 329 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 `v3.0.0`, released June 16, 2026. BSD-3-Clause license. [Source repository](https://github.com/hamcrest/hamcrest-php)

Packages on Packagist run on PHP. [PHP end of life dates](https://since.dev/calendar/php.md).

## hamcrest/hamcrest-php v3.0.0 breaking changes

hamcrest/hamcrest-php v3.0.0, released June 16, 2026: 329 breaking changes.

- **Removed** `Hamcrest\Core\DescribedAs::ARG_PATTERN`  

Hamcrest\\Core\\DescribedAs::ARG_PATTERN was removed in hamcrest/hamcrest-php v3.0.0 [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed**  

Parameters and return values of Hamcrest classes now carry native type hints, so code passing or overriding them with incompatible types may fail. Check custom matchers and subclasses against the new types. [github.com](https://github.com/hamcrest/hamcrest-php/releases/tag/v3.0.0)
- **Signature changed** `allOf`  

Was function allOf(/\* args... \*/); now function allOf(/\* args... \*/): \\Hamcrest\\Core\\AllOf. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `anArray`  

Was function anArray(/\* args... \*/); now function anArray(/\* args... \*/): \\Hamcrest\\Arrays\\IsArray. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `anInstanceOf`  

Was function anInstanceOf($theClass); now function anInstanceOf(string $theClass): \\Hamcrest\\Core\\IsInstanceOf. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `anObject`  

Was function anObject(); now function anObject(): \\Hamcrest\\Type\\IsObject. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `any`  

Was function any($theClass); now function any(string $theClass): \\Hamcrest\\Core\\IsInstanceOf. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `anyOf`  

Was function anyOf(/\* args... \*/); now function anyOf(/\* args... \*/): \\Hamcrest\\Core\\AnyOf. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `anything`  

Was function anything($description = 'ANYTHING'); now function anything(string $description = 'ANYTHING'): \\Hamcrest\\Core\\IsAnything. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `arrayContaining`  

Was function arrayContaining(/\* args... \*/); now function arrayContaining(/\* args... \*/): \\Hamcrest\\Arrays\\IsArrayContainingInOrder. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `arrayContainingInAnyOrder`  

Was function arrayContainingInAnyOrder(/\* args... \*/); now function arrayContainingInAnyOrder(/\* args... \*/): \\Hamcrest\\Arrays\\IsArrayContainingInAnyOrder. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `arrayValue`  

Was function arrayValue(); now function arrayValue(): \\Hamcrest\\Type\\IsArray. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `arrayWithSize`  

Was function arrayWithSize($size); now function arrayWithSize($size): \\Hamcrest\\Arrays\\IsArrayWithSize. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `assertThat`  

Was function assertThat(); now function assertThat(): void. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `atLeast`  

Was function atLeast($value); now function atLeast($value): \\Hamcrest\\Number\\OrderingComparison. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `atMost`  

Was function atMost($value); now function atMost($value): \\Hamcrest\\Number\\OrderingComparison. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `booleanValue`  

Was function booleanValue(); now function booleanValue(): \\Hamcrest\\Type\\IsBoolean. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `boolValue`  

Was function boolValue(); now function boolValue(): \\Hamcrest\\Type\\IsBoolean. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `both`  

Was function both(\\Hamcrest\\Matcher $matcher); now function both(\\Hamcrest\\Matcher $matcher): \\Hamcrest\\Core\\CombinableMatcher. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `callableValue`  

Was function callableValue(); now function callableValue(): \\Hamcrest\\Type\\IsCallable. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `closeTo`  

Was function closeTo($value, $delta); now function closeTo($value, $delta): \\Hamcrest\\Number\\IsCloseTo. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `comparesEqualTo`  

Was function comparesEqualTo($value); now function comparesEqualTo($value): \\Hamcrest\\Number\\OrderingComparison. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `contains`  

Was function contains(/\* args... \*/); now function contains(/\* args... \*/): \\Hamcrest\\Arrays\\IsArrayContainingInOrder. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `containsInAnyOrder`  

Was function containsInAnyOrder(/\* args... \*/); now function containsInAnyOrder(/\* args... \*/): \\Hamcrest\\Arrays\\IsArrayContainingInAnyOrder. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `containsString`  

Was function containsString($substring); now function containsString($substring): \\Hamcrest\\Text\\StringContains. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `containsStringIgnoringCase`  

Was function containsStringIgnoringCase($substring); now function containsStringIgnoringCase($substring): \\Hamcrest\\Text\\StringContainsIgnoringCase. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `describedAs`  

Was function describedAs(/\* args... \*/); now function describedAs(/\* args... \*/): \\Hamcrest\\Core\\DescribedAs. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `doubleValue`  

Was function doubleValue(); now function doubleValue(): \\Hamcrest\\Type\\IsDouble. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `either`  

Was function either(\\Hamcrest\\Matcher $matcher); now function either(\\Hamcrest\\Matcher $matcher): \\Hamcrest\\Core\\CombinableMatcher. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `emptyArray`  

Was function emptyArray(); now function emptyArray(): \\Hamcrest\\Core\\DescribedAs. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `emptyString`  

Was function emptyString(); now function emptyString(): \\Hamcrest\\Text\\IsEmptyString. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `emptyTraversable`  

Was function emptyTraversable(); now function emptyTraversable(): \\Hamcrest\\Collection\\IsEmptyTraversable. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `endsWith`  

Was function endsWith($substring); now function endsWith($substring): \\Hamcrest\\Text\\StringEndsWith. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `equalTo`  

Was function equalTo($item); now function equalTo($item): \\Hamcrest\\Core\\IsEqual. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `equalToIgnoringCase`  

Was function equalToIgnoringCase($string); now function equalToIgnoringCase($string): \\Hamcrest\\Text\\IsEqualIgnoringCase. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `equalToIgnoringWhiteSpace`  

Was function equalToIgnoringWhiteSpace($string); now function equalToIgnoringWhiteSpace($string): \\Hamcrest\\Text\\IsEqualIgnoringWhiteSpace. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `everyItem`  

Was function everyItem(\\Hamcrest\\Matcher $itemMatcher); now function everyItem(\\Hamcrest\\Matcher $itemMatcher): \\Hamcrest\\Core\\Every. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `floatValue`  

Was function floatValue(); now function floatValue(): \\Hamcrest\\Type\\IsDouble. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `greaterThan`  

Was function greaterThan($value); now function greaterThan($value): \\Hamcrest\\Number\\OrderingComparison. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `greaterThanOrEqualTo`  

Was function greaterThanOrEqualTo($value); now function greaterThanOrEqualTo($value): \\Hamcrest\\Number\\OrderingComparison. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::anArray`  

Was public static function anArray(/\* args... \*/); now public static function anArray(/\* args... \*/): self. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::describeMismatchSafely`  

Was protected function describeMismatchSafely($actual, Description $mismatchDescription); now protected function describeMismatchSafely($actual, Description $mismatchDescription): void. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::descriptionEnd`  

Was protected function descriptionEnd(); now protected function descriptionEnd(): string. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::descriptionSeparator`  

Was protected function descriptionSeparator(); now protected function descriptionSeparator(): string. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::descriptionStart`  

Was protected function descriptionStart(); now protected function descriptionStart(): string. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArray::matchesSafely`  

Was protected function matchesSafely($array); now protected function matchesSafely($array): bool. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArrayContaining::describeMismatchSafely`  

Was protected function describeMismatchSafely($array, Description $mismatchDescription); now protected function describeMismatchSafely($array, Description $mismatchDescription): void. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArrayContaining::hasItemInArray`  

Was public static function hasItemInArray($item); now public static function hasItemInArray($item): self. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArrayContaining::matchesSafely`  

Was protected function matchesSafely($array); now protected function matchesSafely($array): bool. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)
- **Signature changed** `Hamcrest\Arrays\IsArrayContainingInAnyOrder::arrayContainingInAnyOrder`  

Was public static function arrayContainingInAnyOrder(/\* args... \*/); now public static function arrayContainingInAnyOrder(/\* args... \*/): self. [packagist.org](https://packagist.org/packages/hamcrest/hamcrest-php#v3.0.0)

And 279 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.
