PHPackages                             typing/types - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. typing/types

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

typing/types
============

PHP primitive wrappers lib.

2181PHP

Since Aug 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/PhpTyping/types)[ Packagist](https://packagist.org/packages/typing/types)[ RSS](/packages/typing-types/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Types
=====

[](#types)

[![Gitter](https://camo.githubusercontent.com/66ccf1d1aaa420963c4a70b2b63d7c57065499561cc1543a2ba1eea7ff189639/68747470733a2f2f696d672e736869656c64732e696f2f6769747465722f726f6f6d2f747970696e672d74797065732f74797065732d737570706f72743f7374796c653d666c61742d737175617265)](https://gitter.im/PhpTyping/Types?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Documentation](https://camo.githubusercontent.com/cc2e19ec63754b68c70536329c02643e10e0ef5d8aa2d9fec09cf6fcf8f77cf1/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f7068702d74797065732f62616467652f3f76657273696f6e3d6c6174657374267374796c653d666c61742d737175617265)](https://github.com/PhpTyping/types-documentation)[![Build Job](https://camo.githubusercontent.com/ee040ed498c8922b4c89641148f18ee0b600a82b48439931489ec986a90e0f71/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f767061737361706572612f30323764636464623661316463313939356132613437653532386161663032302f7261772f6275696c642d737461626c652e6a736f6e)](https://github.com/PhpTyping/types/actions/workflows/build-stable.yaml)[![Patch Job](https://camo.githubusercontent.com/ed707c0cfdaf2871862182e9f86b7a3fd51cd178f65b63ce21ff75d180b10e4a/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f767061737361706572612f64313861366135353363323330386235396466393136633239636536346562362f7261772f7061746368696e672e6a736f6e)](https://github.com/PhpTyping/types/actions/workflows/continous-patching.yaml)[![License](https://camo.githubusercontent.com/5408c159c1e371e233de7b817d20373f47f1d316f0515d2b7d0723c624699982/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f506870547970696e672f74797065733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typing/types)[![Issues](https://camo.githubusercontent.com/9a5eb5101e4aa7b94211076d66f50eed666da05f8cc253c769a2b914d98ce007/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f506870547970696e672f54797065732e7376673f7374796c653d666c61742d737175617265)](https://github.com/PhpTyping/Types/issues)[![Downloads](https://camo.githubusercontent.com/9c5f973e0e1c968a01a23aa140e6bd87017e39852001c787bfa7ce1f3666d9c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747970696e672f74797065732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typing/types)[![Latest](https://camo.githubusercontent.com/04d55f0ab91619ddee31fabf4cda524effa62626c05b119714e26103f6de9a88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747970696e672f74797065732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typing/types)

[![Quality Gate Status](https://camo.githubusercontent.com/f531f68ac0577d9e250ec5d838d89227cc2d4ff23ed55c0984455759e7b67262/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Maintainability Rating](https://camo.githubusercontent.com/43543111930ab61b43d64615263bbe29ab8904943d8c5563bc009f3e60b00af4/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Reliability Rating](https://camo.githubusercontent.com/244b83f755767fedd58c83680e6253df06fb63dc6a321707f703ce8ba361127e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Security Rating](https://camo.githubusercontent.com/8a1c033a87da43e4dafd82e55d8b5905e7b3e358c08b5ef5f7cf388637d14b1b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Bugs](https://camo.githubusercontent.com/a667599acfadae74d14b1b7d11c7dd5c908e9bb05125bb86f0137df925ab4db9/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d62756773267374796c653d666c61742d737175617265)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Coverage](https://camo.githubusercontent.com/3bfeb3e67c2de5aed02479631e4414715a8f24e0a964bada8be1adaeb39444fa/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Duplicated Lines (%)](https://camo.githubusercontent.com/fa7ea937118393d44224af310b81620a5ceab10b5f91433f8dcbf016b02087fe/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Lines of Code](https://camo.githubusercontent.com/8691a92d7426aff8c64c4f9cec300ee8fe6a2a0bc515b33eb8ee20519a307751/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d6e636c6f63)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Technical Debt](https://camo.githubusercontent.com/14085ee7fe6bd01f51c26135417b30aa2cff38477229222d7598c60a2774fc52/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=PhpTyping-types)[![Vulnerabilities](https://camo.githubusercontent.com/8fad7ad4fd8cc65bb229ecaba24ce7372741f9e23c26f777caab11d8b163d984/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506870547970696e672d7479706573266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=PhpTyping-types)

[![PhpTyping](https://raw.githubusercontent.com/TheDevNetwork/Aux/master/images/php-types.png)](https://raw.githubusercontent.com/TheDevNetwork/Aux/master/images/php-types.png)

PHP Primitive wrappers.
-----------------------

[](#php-primitive-wrappers)

### Description

[](#description)

Types is a library that provides a collection of useful primitive wrappers, similar to what other languages can do ( Java, etc). It fixes a few issues some internal functions have, and limits coercion around native PHP functions.

> This library aggregates multiple PHP libraries and wraps them in a single repo, providing decorator classes / sub-types with some extra features.

[SPL\_Types](https://pecl.php.net/package/spl_types) has been broken since...forever. The last release was in [2012](https://pecl.php.net/package/spl_types). No library has tried to do this since, and SPL\_Types providing an empty interface for each primitive object was not terribly useful.

Libraries such as `Doctrine/Collections`, `Stringy`, `PHPMoney/Money`, `MyClabs/Enum` and others like them, are infinitely more useful. They provide rich interfaces that allow you to breeze through coding as opposed to trying to remember the name of specific functions for particular primitives.

Documentation
-------------

[](#documentation)

##### Full docs

[](#full-docs)

[Please see the online documentation](https://phptyping.github.io/types-documentation/)

##### Requirements

[](#requirements)

PHP 8.0 or above.

###### Optional Requirements:

[](#optional-requirements)

- [PHP bcmath](https://secure.php.net/manual/en/book.bc.php)
- [PHP gmp](https://secure.php.net/manual/en/book.gmp.php)

##### Installation

[](#installation)

Using CLI:

```
composer require typing/types:*@stable
```

Or directly on the `composer.json` file:

```
{
    "require": {
        "typing/types": "*@stable"
    }
}
```

See  for more information and documentation.

Contributing
------------

[](#contributing)

For locally testing workflows, use [Act](https://github.com/nektos/act) workflow tester.

If you want to contribute, please read the [CONTRIBUTING](CONTRIBUTING.md).

License
-------

[](#license)

This library is released under the MIT license. See the complete license in the [LICENSE](LICENSE) file.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/de751b37adb4edffedc52c377061e3ece1c914e24fda0f9b355c318704370649?d=identicon)[vpassapera](/maintainers/vpassapera)

---

Top Contributors

[![vpassapera](https://avatars.githubusercontent.com/u/1493758?v=4)](https://github.com/vpassapera "vpassapera (14 commits)")

---

Tags

phpprimitivesspl-typestypingwrapper

### Embed Badge

![Health badge](/badges/typing-types/health.svg)

```
[![Health](https://phpackages.com/badges/typing-types/health.svg)](https://phpackages.com/packages/typing-types)
```

###  Alternatives

[horstoeko/zugferdvisualizer

A library

33198.3k2](/packages/horstoeko-zugferdvisualizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
