PHPackages                             sarciszewski/php-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. [Security](/categories/security)
4. /
5. sarciszewski/php-future

ActiveLibrary[Security](/categories/security)

sarciszewski/php-future
=======================

Polyfill new (5.6+) features into old (5.4+) versions of PHP

v0.6.0(2y ago)411.5M↓15.1%5[1 PRs](https://github.com/sarciszewski/php-future/pulls)7MITPHP

Since Mar 4Pushed 2y ago3 watchersCompare

[ Source](https://github.com/sarciszewski/php-future)[ Packagist](https://packagist.org/packages/sarciszewski/php-future)[ RSS](/packages/sarciszewski-php-future/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (6)Used By (7)

php-future
==========

[](#php-future)

[![Build Status](https://camo.githubusercontent.com/1bc1c52e4b77aa6517fad5b2a5167797ea65c0dd9d6d0d88fbf09bbec6d10494/68747470733a2f2f7472617669732d63692e6f72672f7361726369737a6577736b692f7068702d6675747572652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sarciszewski/php-future)

This library backports some new features into old versions of PHP.

This **MIT Licensed** project is produced and maintained for the good of the PHP developer community.

WARNING ABOUT APPLICATION SECURITY
----------------------------------

[](#warning-about-application-security)

This should ONLY be used in the case that you cannot upgrade PHP for specific reasons within your business rules. For best application security you should always run the latest version of PHP where ever possible. This is intended as a stop gap for those that cannot upgrade and can be used while working toward upgrading to the latest version.

ATTENTION PHP 5.2 / 5.3 USERS
-----------------------------

[](#attention-php-52--53-users)

As a general rule, we do not provide support for [any unsupported versions of PHP](http://php.net/eol.php). This means 5.4.x as of this writing.

If your operating system supports a 5.3.x version that is EOL'd (e.g. PHP 5.3.10 on Ubuntu 12.04 has security fixes backported), we will make exceptions. **The purpose of this library is not to encourage complacency and insecurity. Patch your systems.**

We do not support PHP 5.2.x anywhere. Please upgrade to a newer version of PHP.

Features polyfilled by this library
-----------------------------------

[](#features-polyfilled-by-this-library)

- PHP 5.4
    - N/A
- PHP 5.5
    - `array_column()`
    - `boolval()`
    - `hash_pbkdf2()`
    - `openssl_pbkdf2()`
- PHP 5.6
    - `hash_equals()`
- PHP 7.0
    - N/A

See [wishlist.txt](wishlist.txt) for features we will be providing as time goes on. **To add to this list, either send a pull request, a [tweet](https://twitter.com/vodooKobra), or [an email](https://scott.arciszewski.me/contact) and we'll consider it for inclusion.**

### Out of scope:

[](#out-of-scope)

- Password API - Go directly to [https://github.com/ircmaxell/password\_compat](https://github.com/ircmaxell/password_compat) for these implementations
    - `password_hash()`
    - `password_verify()`
- PHP 7 CSPRNG - Go directly to [https://github.com/paragonie/random\_compat](https://github.com/paragonie/random_compat) for these implementations
    - `random_bytes()`
    - `random_int()`

Why?
----

[](#why)

When our consultants submit security enhancements to open source projects, the maintainers sometimes complain that some features are only in newer versions of PHP so they can't require them. We wrote this to provide compatibility across all versions of PHP and prevent these issues from occurring.

In the future, we will attempt to backport *some* PHP 7 features for use in versions 5.5 and 5.6, where possible.

How it Works
------------

[](#how-it-works)

Features that only exist in future versions are exposed in the global namespace. These functions call the appropriate classes/methods from the `src` folder. This ensures that PHP only load the codes when it actually needs it.

How to use this library
-----------------------

[](#how-to-use-this-library)

### Composer

[](#composer)

```
composer require sarciszewski/php-future
```

### Any script

[](#any-script)

Just include our `autoload.php` script outside of our `src` directory and you're good to go. For example:

```
require_once "vendor/sarciszewski/php-future/autoload.php";
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.7% 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

Every ~834 days

Total

5

Last Release

758d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05d241256cda885139a5697d3bb536b5cec3b430c1adb9c524bf92a37a55758d?d=identicon)[paragonie-scott](/maintainers/paragonie-scott)

---

Top Contributors

[![sarciszewski](https://avatars.githubusercontent.com/u/3710836?v=4)](https://github.com/sarciszewski "sarciszewski (42 commits)")[![gileswells](https://avatars.githubusercontent.com/u/304798?v=4)](https://github.com/gileswells "gileswells (1 commits)")

---

Tags

compatibilitysecurityfuturehash\_equals

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

8519.6M19](/packages/spatie-laravel-csp)[adbario/php-encrypter

Encryption with AES-256 and HMAC-SHA256

117.5k](/packages/adbario-php-encrypter)

PHPackages © 2026

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