NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #96 most downloaded on Packagist
Assertions to validate method input/output with nice error messages.
Last release 2 days ago
05 Oct 2026
Ships unpredictably
gaps range from 9 days to 3.4 years
Nearly every release is documented
notes for 29 of 30 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
32 releases · first in 2015
See change log for changes.
See change log for changes.
keysExist, and the nullOrKeysExist, allKeysExist, and allNullOrKeysExist variants.propertyExists now preserves class-string and object types through its return value, improving static analysis support.See change log for changes.
See change log for changes.
One column per quarter.
uuid assertion to prevent braces and prefixes being inside the value.See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
uniqueValues.string|callable for the message.See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
isList type documentation.isAOf, isInstanceOf, etc type documentation.See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
Corrected @param declaration for isMap.
@param declaration for isMap.BREAKING Remove deprecated isTraversable, use isIterable or isInstanceOf instead.
isTraversable, use isIterable or isInstanceOf instead.declare(strict_types=1) to all classes.notInArray and notOneOf.isInitialized, to check if a class property is initialized.negativeInteger and notNegativeIntegerisStatic and notStaticNothing published for this version
### Fixed - Exclude tools from export.
Corrected messages and typos in various assertions.
void return type.Added explicit (non-magic) allNullOr* methods, with @psalm-assert annotations, for better Psalm support.
allNullOr* methods, with @psalm-assert annotations, for better Psalm support.__callStaticisList will now deal correctly with (modified) lists that contain NaNreportInvalidArgument now has a return type of never.symfony/polyfill-ctype as a dependency, and require ext-ctype instead.
symfony/polyfill-ctype in your project if you need it, as it provides ext-ctypeOn invalid assertion, we throw a Webmozart\Assert\InvalidArgumentException
Webmozart\Assert\InvalidArgumentExceptionAssert::positiveInteger()all*() and nullOr*() methods to improve psalm compatibility.Nothing published for this version
added better Psalm support for all* & nullOr* methods
all* & nullOr* methods@psalm-pure annotation to Assert::notFalse()@psalm-assert annotations where appropriateadded @psalm-pure annotations to pure assertions
Assert::notStartsWith()Assert::notEndsWith()Assert::inArray()@psalm-pure annotations to pure assertionsDateTime(Immutable) objects now display their date & time.Assert::count() now use the values to render the exception message.### Added * added Assert::notFalse() * added Assert::isAOf() * added Assert::isAnyOf() * added Assert::isNotA()
Assert::notFalse()Assert::isAOf()Assert::isAnyOf()Assert::isNotA()added @throws InvalidArgumentException annotations to all methods that throw.
Assert::validArrayKey()Assert::isNonEmptyList()Assert::isNonEmptyMap()@throws InvalidArgumentException annotations to all methods that throw.@psalm-assert for the list type to the isList assertion.ResourceBundle & SimpleXMLElement now pass the isCountable assertions.
They are countable, without implementing the Countable interface.range now has the proper variables.isList and isMap. As it is a valid form of both.
If a non-empty variant is needed, use isNonEmptyList or isNonEmptyMap.deprecated Assert::isTraversable() in favor of Assert::isIterable()
Assert::uniqueValues()Assert::unicodeLetters()Assert::email()@psalm-assert annotations where appropriate.Assert::endsWith() would not give the correct result when dealing with a multibyte suffix.Assert::length(), minLength, maxLength, lengthBetween would not give the correct result when dealing with multibyte characters.NOTE: These 2 changes may break your assertions if you relied on the fact that multibyte characters didn't behave correctly.
Assert::isTraversable() in favor of Assert::isIterable()
trigger_error. It is now annotated as well.added Assert::interfaceExists()
Assert::ip()Assert::ipv4()Assert::ipv6()Assert::notRegex()Assert::interfaceExists()Assert::isList()Assert::isMap()__toString()deprecated Assert::isTraversable() in favor of Assert::isIterable()
Assert::minCount()Assert::maxCount()Assert::countBetween()Assert::isCountable()Assert::notWhitespaceOnly()Assert::natural()Assert::notContains()Assert::isArrayAccessible()Assert::isInstanceOfAny()Assert::isIterable()stringNotEmpty will no longer report "0" is an empty stringAssert::isTraversable() in favor of Assert::isIterable()added extension point Assert::reportInvalidArgument() for custom subclasses
Assert::throws()Assert::count()Assert::reportInvalidArgument() for custom subclassesadded Assert::propertyNotExists()
Assert::object()Assert::propertyExists()Assert::propertyNotExists()Assert::methodExists()Assert::methodNotExists()Assert::uuid()add tests for minimum package dependencies on Travis CI
* added support for PHP 5.3.3
* first stable release
* first beta release
Your coding agent can read these notes before it upgrades. Set up the MCP server →