PHP Classes
elePHPant
Icontem

PHP 7 Features and Release Date - PHP Classes blog

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog PHP 7 Features and Re...   Post a comment Post a comment   See comments See comments (16)   Trackbacks (0)  

Author: Manuel Lemos

Posted on:

Categories: PHP community, News, PHP opinions

So it is settled, after a lot of discussion, the voting process to choose the name for the next major PHP version just ended. The winning proposal is to call PHP 7 the next major version after PHP 5.x.

Read this article to understand the proposals and what to expect for the future of PHP 7 in terms of features and possible release date.




Contents

The PHP 7 Name: Votes and Results

PHP 6 versus PHP 7

The Curse of Language Version 6

PHPNG to Become PHP 7

Top Features for PHP 7

1. Huge Performance Improvements

2. JIT Engine

3. AST: Abstract Syntax Tree

4. Asynchronous Programming

5. Standalone Multi-threading Web Server

When will be the PHP 7 Release Date?

Conclusions


The PHP 7 Name: Votes and Results

PHP 7In the last days there was an intense debate about the name of the next major version.

It was not really important to decide now what the name will be because it will take a while until the next major version is released. However this discussion needed to take place soon or later to make a decision.

The discussion was about calling it PHP 6 or PHP 7. The arguments for each of the proposals were presented in a RFC document called Name of the Next PHP Release.

The vote was started once but it was canceled right after to introduce more arguments before it was restarted. The results were announced one week after the voting restart. The PHP 7 proposal won with 58 votes against 24 votes for PHP 6.

There was an argument on whether votes should be made visible or not before the voting period ends. The idea was to avoid the bandwagon effect. The argument defends that some people will just vote to play along with others, instead of voting on the merits of the proposals. The discussion did not go anywhere.

PHP 6 versus PHP 7

The discussion on the next PHP major version name is over. A decision was made for PHP7, but if you did not follow the arguments, you may be curious to understand what was at stake.

PHP keeps evolving. Every new major release there are new features. Most minor releases are about bug fixes.

More enthusiastic users tend to become very excited with new major releases because they are eager to benefit from newer features as soon as possible.

Also new major releases issue great signs a vitality of the language, reinforcing the belief of PHP fans they have made the right choice to invest on a language that is leading its market.

Other users get more concerned with major releases because new features often come with backwards incompatible changes, meaning that it may lead to more work and great headaches fixing code that was broken by those changes.

So the name of next major version was not that important as long as all users understand that it is a major new version with all the implications.

Those that were in favor of keeping it PHP 6 claimed that it would be the next logical number after the current major PHP version, which is 5 obviously.

Those that were in favor of PHP 7 claimed that PHP 6 was the name of a PHP branch that was killed in 2010. That was a very ambitious development that aimed to bring Unicode support as standard to all PHP text handling.

Since PHP 6 was aborted, proponents of PHP 7 did not want the next major PHP version to be confused with that branch that was killed long time in the past.

The majority of the voting developers preferred to avoid that confusion, so the next major PHP version will be PHP 7.

The Curse of Language Version 6

Those that  are more superstitious may claim there is something wrong with programming language versions and the number 6.

Long before the PHP 6 failure, the Perl language also got stuck with version 6. Perl 6 was supposed to be a totally new language engine after version 5 but with a much greater ambition.

Perl 6 started with a debate in the year 2000 of the language features. A specification was also produced to let the language be implemented without requiring developers to read the sources of a reference implementation.

All these discussions made Perl 6 implementations take years to be developed, to the point that many Perl fans forgotten about it and moved on to other languages.

Obviously it was a coincidence these things happened in version 6. PHP version 6 matters were different and that did not hold anybody's breath to prevent users to keep working with PHP.

PHPNG to Become PHP 7

In parallel to the discussion of the next PHP major version name, another proposal was presented to turn the PHPNG branch as the base of PHP 7.

While the discussions are still in progress and the vote on this proposal did not yet start at the time of this writing, it is very likely this will happen.

However, it is possible that there will still be a release for PHP 5.7 before PHP 7.

Top Features for PHP 7

The whole feature set for PHP 7 is not yet defined. Some features we can already talk about because they are already being implemented. Others we can only speculate based on reasonable guesses.

1. Huge Performance Improvements

The main goal of PHPNG was to bring performance improvements that could at least match what Facebook HHVM provides.

Zeev Suraski of Zend has written an article on which he openly admits that they take HHVM as a competitor of (the Zend Engine based) PHP. This just confirms that the release of HHVM and then Facebook Hack triggered this great interest of Zend to continue to provide the leading implementation of PHP.

On that article he also demonstrates how far PHPNG branch has evolved in terms of performance improvements.

2. JIT Engine

According to Dmitry Stogov of Zend, the development of PHPNG was started with the motivation to research the implementation of a JIT engine for the Zend Engine based PHP.

A JIT engine can dynamically compile Zend opcodes into native machine code that eventually would make the code run faster next time it is run.

While the implementation of a JIT engine is not yet built-in the PHPNG branch, Dmitry mentioned in May that he "spent a significant amount of time experimenting with JIT, and even created a PoC of transparent LLVM based JIT compiler embedded into OPCache".

So it is certainly in the plans of Zend to allow bringing a JIT engine to PHP 7, as according to Zeev Suraski it can "push performance through the roof for an already ultra fast implementation".

3. AST: Abstract Syntax Tree

Recently Nikita Popov proposed the implementation of the generation of an Abstract Syntax Tree as an intermediary step for the PHP compilation process.

It is not the first time Nikita proposes the implementation of an AST compilation step. He already proposed it in 2012.

An AST would provide several advantages that he described in his proposals, including the potential for more optimizations that would make PHP run even faster.

In the latest proposal he describes the possibility to expose the AST to PHP extensions and userland applications. That could open space for more interesting tools like static code analyzers which are often useful to detect bugs or potential source level optimizations of your PHP code.

Nikita already provided a patch to implement AST support on top of the PHPNG branch.

4. Asynchronous Programming

This may not be obvious to everybody, but lately Julien Pauli, one of the maintainers of the latest PHP releases, has been commenting about refactoring PHP I/O multiplexing layer.

This seems to be a necessary step to implement an event loop. An event loop is part of the code that takes care of handling events related with I/O operations and other asynchronous tasks that may be going on in parallel, like accesses to files, network, databases, timers, etc..

In simpler terms, this would allow future PHP versions to easily implement support to the execution of parallel tasks within the same request, thus pushing PHP performance improvement potential to a totally different level.

This is something that I commented in the past several times. One of the latest times was in the article about the improvements of Facebook Hack.

Of course, you do not get automatic performance improvements just by enabling the support for asynchronous programming. New PHP code needs to be written to take advantage of the asynchronous programming potential.

Despite the initial effort of Jean Pauli, it does not mean that asynchronous programming built-in support will be enabled in PHP 7.

However, since Facebook Hack already provides asynchronous programming support in a very elegant way, I would not be surprised if PHP core developers moved faster to make asynchronous programming in PHP available sooner rather than later.

5. Standalone Multi-threading Web Server

This is something that does not seem to be in the plans for PHP 7 but it is something that would make PHP more scalable.

PHP can already be run from multi-threaded Web servers like ngynx, lighttpd or even Apache in worker mode, however that is not the same as having PHP run on its own multi-threading Web server.

A multi-threading Web server can handle many simultaneous requests using a single memory pool, thus avoiding the memory waste that happens when you run PHP as FastCGI or in Apache pre-fork mode.

It would also allow PHP use a single pool of database connections, thus minimizing the number of simultaneous database connections opened during access peaks.

HHVM can already be run as a standalone multi-threading Web server since the days when the project was called HipHop PHP compiler.

This allowed Facebook to reduce bit of server machines needed to handle the high load of accesses that they have.

Despite running PHP as a standalone multi-threading Web server is not yet in the plans for PHP 7, it is certainly something good to have, at least for PHP 8.

When will be the PHP 7 Release Date?

It is too early to have a good estimate of the release date of PHP 7. Different people estimate it will take between 1 to 3 years. A reasonable guess is to expect a final PHP 7 release some time in 2016, although it is not impossible to see early alpha versions still in 2015.

So, for now you can count with at least 1 year of waiting until can start trying PHP 7.

Conclusions

The latest developments of the PHP language has certainly been very exciting.

If it is fair to admit that most of these developments were a consequence of Facebook pushing forward HHVM and the Hack Language, I think we should thank Facebook for that push.

I suspect they did it intentionally, I mean, they pushed HHVM and Hack to make the PHP core developers wake up and move faster. In that case, it worked! Nevertheless it was a good thing for the PHP community in general, so nobody should complain.

What do you think? Did you like these latest PHP language developments? Is there anything else you would like to see happening to the PHP language to move on further? Post a comment to tell what you think.


You need to be a registered user or login to post a comment

1,321,797 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:

FacebookGmail
HotmailStackOverflow
GitHubYahoo


Comments:

8. PHP Should compite with Java - neeraj kumar (2015-04-10 17:11)
PHP Should compite with Java... - 0 replies
Read the whole comment and replies

7. Such a Great article of PHP7!!! - cheneyxu (2014-09-04 10:24)
Thanks for your article,really.... - 0 replies
Read the whole comment and replies

6. Asynchronous programming - Jared Hohman (2014-09-04 02:40)
Already doable... - 1 reply
Read the whole comment and replies

5. Unicode - Andre Polykanine A.K.A. Menelion Elensúlë (2014-08-06 20:37)
Still no unicode support?... - 4 replies
Read the whole comment and replies

2. Builtin-Webserver - Markus S. (2014-08-04 19:57)
Webserver feature was dropped in HHVM... - 2 replies
Read the whole comment and replies

1. backwards incompatible changes - Rene Nieuwburg (2014-08-04 11:12)
Please answer this concern.... - 1 reply
Read the whole comment and replies

4. latest PHP developments - MUITUMWA (2014-08-04 10:40)
i like it...the challenging the naming of versions increase effi... - 0 replies
Read the whole comment and replies

3. Thanks - selcuk mart (2014-08-04 10:40)
Thanks... - 0 replies
Read the whole comment and replies



  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog PHP 7 Features and Re...   Post a comment Post a comment   See comments See comments (16)   Trackbacks (0)