https://github.com/ducks-project/spl-types
Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string
https://github.com/ducks-project/spl-types
compat component enum enumerator php polyfill portability
Last synced: about 1 year ago
JSON representation
Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string
- Host: GitHub
- URL: https://github.com/ducks-project/spl-types
- Owner: ducks-project
- License: mit
- Created: 2015-11-25T16:49:28.000Z (over 10 years ago)
- Default Branch: 7.x
- Last Pushed: 2025-01-17T21:52:18.000Z (over 1 year ago)
- Last Synced: 2025-04-28T12:05:02.140Z (about 1 year ago)
- Topics: compat, component, enum, enumerator, php, polyfill, portability
- Language: PHP
- Homepage: https://github.com/ducks-project/spl-types
- Size: 426 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# SplTypes
[](https://github.com/ducks-project/spl-types)
[](https://coveralls.io/github/ducks-project/spl-types)
[](https://dl.circleci.com/status-badge/redirect/gh/ducks-project/spl-types/tree/master)
[](https://scrutinizer-ci.com/g/ducks-project/spl-types/?branch=master)
[](https://scrutinizer-ci.com/g/ducks-project/spl-types/?branch=master)
[](https://scrutinizer-ci.com/g/ducks-project/spl-types/build-status/master)
[](https://scrutinizer-ci.com/code-intelligence)
[](https://codecov.io/github/ducks-project/spl-types)
[](https://ci.appveyor.com/project/donaldinou/spl-types)
[](https://shepherd.dev/github/ducks-project/spl-types)
[](https://shepherd.dev/github/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://packagist.org/packages/ducks-project/spl-types)
[](https://opencollective.com/ducks-project)
[](https://opencollective.com/ducks-project)
[](https://spl-types.readthedocs.io/en/latest/?badge=latest)
[](code_of_conduct.md)
* Project page: https://github.com/ducks-project/spl-types
* Repository: https://github.com/ducks-project/spl-types
* Original PHP extension: http://php.net/manual/en/intro.spl-types.php
[](https://app.circleci.com/insights/github/ducks-project/spl-types/workflows/workflow/overview?branch=7.x&reporting-window=last-30-days&insights-snapshot=true)
## Description
This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string
It provides classes unavailable if you can't install [SPL Types](http://php.net/manual/en/intro.spl-types.php) extension:
- [`SplType`]
- [`SplInt`]
- [`SplFloat`]
- [`SplEnum`]
- [`SplBool`]
- [`SplString`]
## General information
Since [v7.0.0](./CHANGELOG.md#v700), breaking changes has appeared in relation to the pecl extension.
This is mainly due to the lack of maintenance and relevance of the original extension,
associated with the strong typing introduced in:
[php 7.4](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
and the existence of [enums](https://www.php.net/manual/en/language.types.enumerations.php) since php 8.
## Glossary
- [Changelog]
- [Lexique]
- [Issues And Limitations]
- [How To]
## License
This library is released under the [MIT license].
[`SplType`]: /assets/documentation/classes/SplType.md
[`SplInt`]: /assets/documentation/classes/SplInt.md
[`SplFloat`]: /assets/documentation/classes/SplFloat.md
[`SplEnum`]: /assets/documentation/classes/SplEnum.md
[`SplBool`]: /assets/documentation/classes/SplBool.md
[`SplString`]: /assets/documentation/classes/SplString.md
[`SplEnumerable`]: /assets/documentation/classes/SplEnumerable.md
[`SplUnitEnum`]: /assets/documentation/classes/SplUnitEnum.md
[`SplBackedEnum`]: /assets/documentation/classes/SplBackedEnum.md
[Lexique]: /assets/documentation/Lexique.md
[Issues And Limitations]: /assets/documentation/IssuesAndLimitations.md
[How To]: /assets/documentation/HowTo.md
[Changelog]: CHANGELOG.md
[MIT license]: LICENSE