PHP 7.1: the road towards PHP 7.2 and PHP 8.0

September 15, 2016php, php-7.1, english
 This has been written a few years ago and might not be up-to-date…

Cet article est aussi disponible en français.
This is the 10th post in a series about PHP 7.1.


PHP 7.1 is only the second minor version of the PHP 7 branch, but some are already thinking about what’s next: the next minor release, PHP 7.2; and the next major version, what might become PHP 8.0.


Some removal for PHP 8.0

There are not (yet?) any deep changes in the engine, but the idea for now is to start adding some E_DEPRECATED or E_NOTICE warning on features you should not be using with PHP 7.x — and, then, to remove them in PHP 8.0.

Eval option of mb_ereg_replace()

The /e modifier of preg_replace() has been removed with PHP 7.0 (‣RFC), but it still exists for mb_ereg_replace().

To make things more consistent, using this dangerous modifier for functions mb_ereg_replace() and mb_eregi_replace() with PHP 7.1 will raise a E_DEPRECATED warning.

Instead, use mb_ereg_replace_callback().

This modifier should later be removed, with PHP 8.0.

‣ The RFC: Deprecate mb_ereg_replace() eval option


The end of mcrypt?

The mcrypt extension is based on a library that’s not been maintained for years — which is a bit of a problem, considering it’s related to security!

When PHP 7.0 was in development, there were talks about removing this extension. But, as many developers are still using it, it’s not been done.

To facilitate migration and leave more time to developers, mcrypt will be flagged as deprecated starting from PHP 7.1: using it will cause E_DEPRECATED warnings.

The mcrypt extension should then be removed for PHP 8.0.

‣ The RFC: Deprecate (then Remove) Mcrypt


And for PHP 7.2?

As the release of PHP 7.1 is getting close, adding features to this version is not possible anymore — it’s not been permitted for a few months now, actually.

No surprise: a couple of ideas are already being discussed, for what might become the next version: PHP 7.2.


Here are a few RFCs resulting from these ideas.

As always, some of those will follow the process until the voting phase, a few will pass, and many will be forgotten:

Once again: the fact an RFC has been written does not mean the corresponding idea will lead to a new feature for PHP!