tea / future
Polyfill backporting some PHP 5.4+, 5.5+ ,5.6+, 7.0+ and 7.1+ features to lower PHP versions.
Installs: 100
Dependents: 6
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tea/future
Requires
- php: >=5.3.3
- symfony/polyfill-php54: ~1.3.0
- symfony/polyfill-php55: ~1.3.0
- symfony/polyfill-php56: ~1.3.0
- symfony/polyfill-php70: ~1.3.0
- symfony/polyfill-php71: ~1.3.0
This package is not auto-updated.
Last update: 2025-10-26 01:53:44 UTC
README
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 PHP packages.
Installation
Composer is required to install and load the dependencies.
On your composer managed project, run:
composer require tea/future
Then load composer's autoloader:
require 'vendor/autoload.php';
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+
Functions:
PHP 7.0+
Functions:
intdivpreg_replace_callback_arrayerror_clear_lastrandom_bytesandrandom_int(from paragonie/random_compat)
Classes:
Compatibility notes
To write portable code between PHP5 and PHP7, some care must be taken:
\*Errorexceptions must be caught before\Exception;- after calling
error_clear_last(), the result of$e = error_get_last()must be verified usingisset($e['message'][0])instead ofnull === $e.
PHP 5.6+
Functions:
hash_equals(part of hash extension)ldap_escape(part of ldap extension)
PHP 5.5+
Functions:
boolvaljson_last_error_msgarray_columnhash_pbkdf2password_*functions (from ircmaxell/password_compat)
PHP 5.4+
Functions:
Other
If you only need a polyfill for a specific PHP version, you can simply install the respective
symfony/polyfill-phpXX package.
License
This library is released under the MIT license.