sebastian/type
Collection of value objects that represent the types of the PHP type system
7.0.2
690M downloads/mo
#60 most downloaded on composer
sebastianbergmann/type
What this package is like to depend on
Last release 13 days 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
4 releases in the last 12 months
see the full history below
Release timeline
36 releases · Jun 2019 to Aug 2026
2020
2021
2022
2023
2024
2025
2026
Releases
latest 36-
7.0.210 Aug 2026Release notes
Open source →Changed
- Improved the performance of
Type::fromValue()as well asisAssignable()for object, callable, and iterable types
Fixed
CallableType::isAssignable()andIterableType::isAssignable()raise an error when the other type is anObjectTypefor a class that does not exist-
TypeName::fromReflection()cannot be called with aReflectionClassobject for a concrete class without an error being reported by PHPStan
Release notes
Open source →Changed
- Improved the performance of
Type::fromValue()as well asisAssignable()for object, callable, and iterable types
Fixed
CallableType::isAssignable()andIterableType::isAssignable()raise an error when the other type is anObjectTypefor a class that does not exist-
TypeName::fromReflection()cannot be called with aReflectionClassobject for a concrete class without an error being reported by PHPStan
- Improved the performance of
-
7.0.120 May 2026Release notes
Open source →Fixed
- #18: Class aliases are not resolved when checking type assignability
Release notes
Open source →Fixed
- #18: Class aliases are not resolved when checking type assignability
-
7.0.006 Feb 2026 -
6.0.420 May 2026Release notes
Open source →Fixed
- #18: Class aliases are not resolved when checking type assignability
Release notes
Open source →Fixed
- #18: Class aliases are not resolved when checking type assignability
-
6.0.309 Aug 2025 -
6.0.218 Mar 2025Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
- #33:
-
6.0.118 Mar 2025Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
- #33:
-
6.0.007 Feb 2025 -
5.1.309 Aug 2025 -
5.1.218 Mar 2025Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
- #33:
-
5.1.118 Mar 2025Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
Release notes
Open source →Fixed
- #33:
ReflectionMapperdoes not handle unions that containiterablecorrectly
- #33:
-
5.1.017 Sep 2024Release notes
Open source →Added
- Added
ReflectionMapper::fromPropertyType()for mapping\ReflectionPropertyto aTypeobject
- Added
-
5.0.103 Jul 2024Release notes
Open source →Changed
- This project now uses PHPStan instead of Psalm for static analysis
-
5.0.002 Feb 2024 -
4.0.003 Feb 2023Release notes
Open source →Removed
- This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0
-
3.2.103 Feb 2023 -
3.2.012 Sep 2022Release notes
Open source →Added
- #25: Support Disjunctive Normal Form types
- Added
ReflectionMapper::fromParameterTypes() - Added
IntersectionType::types()andUnionType::types() - Added
UnionType::containsIntersectionTypes()
-
3.1.029 Aug 2022 -
3.0.015 Mar 2022Release notes
Open source →Added
- Support for intersection types introduced in PHP 8.1
- Support for the
neverreturn type introduced in PHP 8.1 - Added
Type::isCallable(),Type::isGenericObject(),Type::isIterable(),Type::isMixed(),Type::isNever(),Type::isNull(),Type::isObject(),Type::isSimple(),Type::isStatic(),Type::isUnion(),Type::isUnknown(), andType::isVoid()
Changed
- Renamed
ReflectionMapper::fromMethodReturnType(ReflectionMethod $method)toReflectionMapper::fromReturnType(ReflectionFunctionAbstract $functionOrMethod)
Removed
- Removed
Type::getReturnTypeDeclaration()(useType::asString()instead and prefix its result with': ') - Removed
TypeName::getNamespaceName()(useTypeName::namespaceName()instead) - Removed
TypeName::getSimpleName()(useTypeName::simpleName()instead) - Removed
TypeName::getQualifiedName()(useTypeName::qualifiedName()instead)
-
2.3.415 Jun 2021 -
2.3.204 Jun 2021 -
2.3.126 Oct 2020 -
2.3.006 Oct 2020 -
2.2.228 Sep 2020Release notes
Open source →Changed
- Changed PHP version constraint in
composer.jsonfrom^7.3 || ^8.0to>=7.3
- Changed PHP version constraint in
-
2.2.105 Jul 2020Release notes
Open source →Fixed
- Fixed handling of
mixedtype inReflectionMapper::fromMethodReturnType()
- Fixed handling of
-
2.2.005 Jul 2020 -
2.1.126 Jun 2020 -
2.1.001 Jun 2020Release notes
Open source →Added
- Added
UnionTypeobject for representing PHP 8's Union Types - Added
ReflectionMapper::fromMethodReturnType()for mapping\ReflectionMethod::getReturnType()to aTypeobject - Added
Type::name()for retrieving the name of a type - Added
Type::asString()for retrieving a textual representation of a type
Changed
- Deprecated
Type::getReturnTypeDeclaration()(useType::asString()instead and prefix its result with': ') - Deprecated
TypeName::getNamespaceName()(useTypeName::namespaceName()instead) - Deprecated
TypeName::getSimpleName()(useTypeName::simpleName()instead) - Deprecated
TypeName::getQualifiedName()(useTypeName::qualifiedName()instead)
- Added
-
2.0.007 Feb 2020 -
1.1.501 Mar 2024Nothing published for this version
-
1.1.430 Nov 2020Nothing published for this version
-
1.1.302 Jul 2019 -
1.1.219 Jun 2019 -
1.1.108 Jun 2019 -
1.1.007 Jun 2019 -
1.0.006 Jun 2019