NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #539 most downloaded on Packagist
Thin assertion library for input validation in business models.
Latest stable
v3.3.4
Last release 5 months ago
10 Jun 2026
Release timing varies
gaps range from 2 weeks to 2.6 years
Most releases are documented
notes for 46 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
63 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Update GitHub Action versions by @TimWolla in https://github.com/beberlei/assert/pull/347
Full Changelog: https://github.com/beberlei/assert/compare/v3.3.3...v3.3.4
[PHP 8.4] Fixes for implicit nullability deprecation by @Ayesh in https://github.com/beberlei/assert/pull/337
.github/ export-ignore to .gitattributes by @TimWolla in https://github.com/beberlei/assert/pull/326Full Changelog: https://github.com/beberlei/assert/compare/v3.3.2...v3.3.3
Your coding agent can read these notes before it upgrades. Set up the MCP server →
PHP 8.1 compatible by @frankvanhest in https://github.com/beberlei/assert/pull/320
Full Changelog: https://github.com/beberlei/assert/compare/v3.3.1...v3.3.2
Merge changes from 3.2.7 missing in 3.3.0 thanks to @wilsonge
Nothing published for this version
- #302 PHP 8 support thanks to @ptondereau - #304 Migrate from TravisCI to Github Actions - #296 Add Assert::uniqueValues thanks to @gronostajo
Assert::uniqueValues thanks to @gronostajoReinstated the @method return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.
@method return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.Make Assert\Assertion::stringify() UTF-8 safe (Thanks to Pedram Azimaei)
REALLY Removed dependency of the intl extension.
Assert\Assertion::all() helper to show that the value is expected to be an array.It seems I've been slightly lax in verifying the signature changes and expected extensions. Hopefully, both of these have been fixed in this version.
\Assert\Assertion::createException() signature to 3.2.2.Assert\Assertion::count(), Assert\Assertion::isCountable(), Assert\Assertion::minCount(), and Assert\Assertion::maxCount() will operate on ResourceBundles.@method return type for Assert\LazyAssertion methods to show that the return type is static for extensions of Assert\LazyAssertion.@method whose returns type is of the subclass and a @method that is called statically (PSR-5#899). So the use of static static is a fudge that sort of works for IDEs that need to know about the method that MAY be overridden in a subclass.Added type hints and documentation consistency (Thanks to Andru Cherny)
Assertion::eqArraySubset() (Thanks to Anna Filina)
Updated regex for Assert\Assertion::url() (Thanks to Christophe Histaesse)
Assert\Assertion::url() (Thanks to Christophe Histaesse)Assert\Assertion::url() (Thanks to Menno Holtkamp)Assert\Assertion::NullOrXxxx() to show that the first parameter can be null.Assert\LazyAssertion to show that the return type is $this to aid IDE's static analysis.Assertion::isCountable() (Thanks to Baptiste Clavié)
Assertion::isCountable() (Thanks to Baptiste Clavié)Assertion::maxCount() (Thanks to Baptiste Clavié)Assertion::minCount() (Thanks to Baptiste Clavié)Assertion::nonContains() (Thanks to Baptiste Clavié)\ResourceBundle and \SimpleXMLElement to Assertion::count().Refactor assertion messages for Assert\Assertion::notEq(), Assert\Assertion::notSame(), and Assert\Assertion::notInArray() (Thanks to Rick Kuipers)
Assert\Assertion::notEq(), Assert\Assertion::notSame(), and Assert\Assertion::notInArray() (Thanks to Rick Kuipers)Assertion::notRegex() (Thanks to Thomas Müller)
Assertion::notRegex() (Thanks to Thomas Müller)Assert\Assertion::url() to latest from Symfony/ValidatorDeprecate support for PHP < 7.0
AssertionFailedException must be a Throwable (Thanks to Marco Pivetta)Removed version number from composer.json to allow tag to provide version number
Made constraints in exceptions consistent for all assertions (Thanks to Peter Kruithof)
Remove DocBlock entry causing exception in third party DocBlock parser (Thanks to Koutsoumpos Valantis)
Prevent date overflow in Assertion::date() by reset preset date value (Thanks to Nobuhiro Nakamura)
Expand error for \Assert\Assertion::count() to include the supplied count (Thanks to Yoann Blot)
\Assert\Assertion::count() to include the supplied count (Thanks to Yoann Blot)Usage of custom extended Assertion class in LazyAssertion (Thanks to Marek Štípek)
Support for PHP 5 will be dropped at the end of 2018, in line with PHP's supported versions.
\Assert\Assertion::generateMessage() will now receive the default message for an assertion if one is not supplied (Thanks to Romans Malinovskis)The functions \Assert\that(), \Assert\thatAll(), \Assert\thatNullOr(), and \Assert\lazy() are no longer marked as deprecated. Both the functional and…
Assertion::integerish() has had several issues in the last couple of versions.\Assert\that(), \Assert\thatAll(), \Assert\thatNullOr(), and \Assert\lazy() are no longer marked as deprecated.Assertion::integerish(0) and Assertion::integerish('0') now assert correctly.
Assertion::integerish(0) and Assertion::integerish('0') now assert correctly.Assertion::base64() (Thank to Pablo Kowalczyk)
Assertion::integerish([]) now correctly asserts integers with leading zeros in strings (Thank to Albert Casademont)
Assertion::integerish([]) now correctly asserts integers with leading zeros in strings (Thank to Albert Casademont)Assertion::integerish() now correctly asserts integers with leading zeros in strings (Thanks to Albert Casademont)Assertion::integerish([]) now throws exception as expected (Thank to Thomas Flack)
Assertion::integerish([]) now throws exception as expected (Thank to Thomas Flack)Assertion::integerish() now throws exception as expected (Thanks to Thomas Flack)Basic Auth usernames and passwords can contain '.' (Thank to Fede Isas)
Fixed stringification of booleans (Thank to Philipp Rieber)
Assert\Assertion:isResource() (Thanks to Timothy Younger)
Assert\Assertion:isResource() (Thanks to Timothy Younger)Assert\Assertion::propertiesExist().Unit tests no longer using deprecated exception methods (Thanks to Richard Quadling)
Assert\Assertion::objectOrClass() (Thanks to Timothy Younger)Assert\Assertion::propertyExists() (Thanks to Timothy Younger)Assert\Assertion::propertiesExist() (Thanks to Timothy Younger)Fix Assert\Assertion::integerish() when used with a resource (Thanks to manuxi)
Assert\Assertion::integerish() when used with a resource (Thanks to manuxi)Backward compatibility fixes for PHP 5.3
Assert\Assertion::extensionVersion() (Thanks to Timothy Younger)
Assert\Assertion::extensionVersion() (Thanks to Timothy Younger)Assert\Assertion::phpVersion() (Thanks to Timothy Younger)Assert\Assertion::version() (Thanks to Timothy Younger)Assert\Assertion::defined() (Thanks to Timothy Younger)
Assert\Assertion::defined() (Thanks to Timothy Younger)Assert\Assertion::extensionLoaded() (Thanks to Timothy Younger)All exceptions thrown by this library extend \Assert\InvalidArgumentException (Thanks to Richard Quadling)
\Assert\InvalidArgumentException (Thanks to Richard Quadling)…and \Assert\lazy()) are now marked as deprecated. They will be removed in the next major release. They have been replaced with the static methods \Ass…
\Assert\that(), \Assert\thatAll(), \Assert\thatNullOr() and \Assert\lazy()) are now marked as deprecated.
They will be removed in the next major release.
They have been replaced with the static methods \Assert\Assert::that(), \Assert\Assert::thatAll(), \Assert\Assert::thatNullOr() and \Assert\Assert::lazy()Make all assertions return true on success, so that it can be used inside PHP 7 assert()
Assert\Assertion::betweenExclusive()
Assert\Assertion::between()Assert\Assertion::betweenExclusive()http://localhost as a valid URL - fixes Assertion::url('http://localhost') not a valid url?Assert\Assertion::url() to latest from Symfony/Validatore164 - The international public telecommunication numbering plan
composer.lock file from libraryAssert\Assertion::e164() - The international public telecommunication numbering planAssert\Assertion::interfaceExists()Assert\Assertion::ip() / Assert\Assertion::ipv4() / Assert\Assertion::ipv6()Assert\Assertion::keyNotExists()Assert\Assertion::null()Assert\Assertion::satisfy() - Allows for a bespoke assertion, rather than a predefined onecomposer.lock file from libraryAdded Assert\Assertion::notInArray(). Made Assert\Assertion::INVALID_GREATER_OR_EQUAL unique. Introduced CONTRIBUTING.md to get contributors to genera
Added Assert\Assertion::notInArray().
Made Assert\Assertion::INVALID_GREATER_OR_EQUAL unique.
Introduced CONTRIBUTING.md to get contributors to generate the docblocks when a new assertion is added.
Introduced .editorconfig to allow IDEs that support EditorConfig to provide a consistent code style. See EditorConfig for further details.
Additional tests and updated documentation.
Travis updates.
Assert\Assertion::notInArray()Assert\Assertion::INVALID_GREATER_OR_EQUAL uniqueFixed unit test to work with PHP 5.3
Fixed Assertion::isCallable() to with with PHP 5.3
Assertion::isCallable() to with with PHP 5.3Updated generate_method_docs.php and regenerated all documentation
generate_method_docs.php and regenerated all documentationUpdated missing assertions from documentation
Pass constraints and values to Assert\AssertionFailedException
Assert\AssertionFailedExceptionNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.