Polyfill backporting some PHP 5.4+, 5.5+ ,5.6+, 7.0+ and 7.1+ features to lower PHP versions.
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.
Composer is required to install and load the dependencies.
On your composer managed project, run:
composer require tea/future
Then load composer's autoloader:
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:
To write portable code between PHP5 and PHP7, some care must be taken:
\*Errorexceptions must be caught before
- after calling
error_clear_last(), the result of
$e = error_get_last()must be verified using
null === $e.
password_*functions (from ircmaxell/password_compat)
If you only need a polyfill for a specific PHP version, you can simply install the respective
This library is released under the MIT license.