NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #62 most downloaded on Packagist
Collection of value objects that represent the types of the PHP type system
Last release 1 months ago
10 Aug 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 34 of 36 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
36 releases · first in 2019
Improved the performance of Type::fromValue() as well as isAssignable() for object, callable, and iterable types
Type::fromValue() as well as isAssignable() for object, callable, and iterable typesCallableType::isAssignable() and IterableType::isAssignable() raise an error when the other type is an ObjectType for a class that does not existTypeName::fromReflection() cannot be called with a ReflectionClass object for a concrete class without an error being reported by PHPStanFixed #18 : Class aliases are not resolved when checking type assignability
One column per quarter.
This component is no longer supported on PHP 8.3
Fixed #18 : Class aliases are not resolved when checking type assignability
Fixed #34 : infection.json is missing from .gitattributes
infection.json is missing from .gitattributesFixed #33 : ReflectionMapper does not handle unions that contain iterable correctly
ReflectionMapper does not handle unions that contain iterable correctlyFixed #33 : ReflectionMapper does not handle unions that contain iterable correctly
ReflectionMapper does not handle unions that contain iterable correctlyThis component is no longer supported on PHP 8.2
Fixed #34 : infection.json is missing from .gitattributes
infection.json is missing from .gitattributesFixed #33 : ReflectionMapper does not handle unions that contain iterable correctly
ReflectionMapper does not handle unions that contain iterable correctlyFixed #33 : ReflectionMapper does not handle unions that contain iterable correctly
ReflectionMapper does not handle unions that contain iterable correctlyAdded ReflectionMapper::fromPropertyType() for mapping \ReflectionProperty to a Type object
ReflectionMapper::fromPropertyType() for mapping \ReflectionProperty to a Type objectThis project now uses PHPStan instead of Psalm for static analysis
This component is no longer supported on PHP 8.1
This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0
### Fixed * #28: Potential undefined offset warning/notice
Added ReflectionMapper::fromParameterTypes()
ReflectionMapper::fromParameterTypes()IntersectionType::types() and UnionType::types()UnionType::containsIntersectionTypes()### Added * #21: Support true as stand-alone type
true as stand-alone typeSupport for intersection types introduced in PHP 8.1
never return type introduced in PHP 8.1Type::isCallable(), Type::isGenericObject(), Type::isIterable(), Type::isMixed(), Type::isNever(), Type::isNull(), Type::isObject(), Type::isSimple(), Type::isStatic(), Type::isUnion(), Type::isUnknown(), and Type::isVoid()ReflectionMapper::fromMethodReturnType(ReflectionMethod $method) to ReflectionMapper::fromReturnType(ReflectionFunctionAbstract $functionOrMethod)Type::getReturnTypeDeclaration() (use Type::asString() instead and prefix its result with ': ')TypeName::getNamespaceName() (use TypeName::namespaceName() instead)TypeName::getSimpleName() (use TypeName::simpleName() instead)TypeName::getQualifiedName() (use TypeName::qualifiedName() instead)Fixed regression introduced in 2.3.3
Fixed handling of tentatively declared return types
SebastianBergmann\Type\Exception now correctly extends \Throwable
SebastianBergmann\Type\Exception now correctly extends \Throwable### Added * #14: Support for static return type that is introduced in PHP 8
static return type that is introduced in PHP 8Changed PHP version constraint in composer.json from ^7.3 || ^8.0 to >=7.3
composer.json from ^7.3 || ^8.0 to >=7.3Fixed handling of mixed type in ReflectionMapper::fromMethodReturnType()
mixed type in ReflectionMapper::fromMethodReturnType()Added MixedType object for representing PHP 8's mixed type
MixedType object for representing PHP 8's mixed typeThis component is now supported on PHP 8
Deprecated Type::getReturnTypeDeclaration() (use Type::asString() instead and prefix its result with ': ')
UnionType object for representing PHP 8's Union TypesReflectionMapper::fromMethodReturnType() for mapping \ReflectionMethod::getReturnType() to a Type objectType::name() for retrieving the name of a typeType::asString() for retrieving a textual representation of a typeType::getReturnTypeDeclaration() (use Type::asString() instead and prefix its result with ': ')TypeName::getNamespaceName() (use TypeName::namespaceName() instead)TypeName::getSimpleName() (use TypeName::simpleName() instead)TypeName::getQualifiedName() (use TypeName::qualifiedName() instead)This component is no longer supported on PHP 7.2
Nothing published for this version
Nothing published for this version
Fixed class name comparison in ObjectType to be case-insensitive
ObjectType to be case-insensitive### Fixed * Fixed handling of object type
object typeFixed autoloading of callback_function.php fixture file
callback_function.php fixture fileAdded support for callable type
callable typeiterable typeInitial release based on code contributed by Michel Hartmann to PHPUnit
Your coding agent can read these notes before it upgrades. Set up the MCP server →