PHPackages                             tea/future - 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. tea/future

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

tea/future
==========

Polyfill backporting some PHP 5.4+, 5.5+ ,5.6+, 7.0+ and 7.1+ features to lower PHP versions.

v0.1.0(9y ago)1100MITPHPPHP &gt;=5.3.3

Since Nov 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/TeaLabs/future)[ Packagist](https://packagist.org/packages/tea/future)[ Docs](https://github.com/TeaLabs/future)[ RSS](/packages/tea-future/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Tea Future
==========

[](#tea-future)

This package back-ports features found in the latest PHP versions. It provides many of the new features in PHP 5.4+, 5.5+ ,5.6+, 7.0+ and 7.1+ to lower PHP versions.

> Most of these features are provided by [symfony polyfill](https://github.com/symfony/polyfill "Symfony Polyfill Package") PHP packages.

Installation
------------

[](#installation)

[Composer](https://getcomposer.org/ "Dependency Manager for PHP") is required to install and load the dependencies.

On your composer managed project, run:

```
composer require tea/future

```

Then load [composer's](https://getcomposer.org/ "Dependency Manager for PHP") autoloader:

```
require 'vendor/autoload.php';

```

Features
--------

[](#features)

Future provides many of the new PHP functions and classes introduced in PHP 5.4 through to PHP 7.1.

Here are the back-ported features by PHP version:

### PHP 7.1+

[](#php-71)

Functions:

- [`is_iterable`](http://php.net/is_iterable)

### PHP 7.0+

[](#php-70)

Functions:

- [`intdiv`](http://php.net/intdiv)
- [`preg_replace_callback_array`](http://php.net/preg_replace_callback_array)
- [`error_clear_last`](http://php.net/error_clear_last)
- `random_bytes` and `random_int` (from [paragonie/random\_compat](https://github.com/paragonie/random_compat))

Classes:

- [`*Error` throwable classes](http://php.net/Error)

#### Compatibility notes

[](#compatibility-notes)

To write portable code between PHP5 and PHP7, some care must be taken:

- `\*Error` exceptions must be caught before `\Exception`;
- after calling `error_clear_last()`, the result of `$e = error_get_last()` must be verified using `isset($e['message'][0])` instead of `null === $e`.

### PHP 5.6+

[](#php-56)

Functions:

- [`hash_equals`](http://php.net/hash_equals) (part of [hash](http://php.net/hash) extension)
- [`ldap_escape`](http://php.net/ldap_escape) (part of [ldap](http://php.net/ldap) extension)

PHP 5.5+
--------

[](#php-55)

Functions:

- [`boolval`](http://php.net/boolval)
- [`json_last_error_msg`](http://php.net/json_last_error_msg)
- [`array_column`](http://php.net/array_column)
- [`hash_pbkdf2`](http://php.net/hash_pbkdf2)
- `password_*` functions (from [ircmaxell/password\_compat](https://github.com/ircmaxell/password_compat))

PHP 5.4+
--------

[](#php-54)

Functions:

- [`trait_exists`](http://php.net/trait_exists)
- [`class_uses`](http://php.net/class_uses)
- [`hex2bin`](http://php.net/hex2bin)
- [`session_register_shutdown`](http://php.net/session_register_shutdown)

Other
-----

[](#other)

If you only need a polyfill for a specific PHP version, you can simply install the respective [`symfony/polyfill-phpXX`](https://github.com/symfony/polyfill "Symfony Polyfill Package") package.

License
-------

[](#license)

This library is released under the [MIT license](LICENSE).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3453d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d55265b6d1f06d4d42a28e06b71bdec921e3f1eccff0a0bd2b7bb9f82eb07db?d=identicon)[davidkyalo](/maintainers/davidkyalo)

---

Top Contributors

[![davidkyalo](https://avatars.githubusercontent.com/u/1615382?v=4)](https://github.com/davidkyalo "davidkyalo (19 commits)")

---

Tags

compatibilityportablepolyfillshim

### Embed Badge

![Health badge](/badges/tea-future/health.svg)

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

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.8k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)[symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

2.4k581.8M67](/packages/symfony-polyfill-php73)[symfony/polyfill-php80

Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions

1.7k815.2M457](/packages/symfony-polyfill-php80)

PHPackages © 2026

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