Thursday, August 28, 2014

PHP 7: What To Expect? Features and Expected Release Date

We are not completely sure about the exact feature set of version 7 of PHP. There are some features that we can talk about since they are being implemented in PHP 7. The rest we can only speculate based on reasonable guesses.

1. PHPNG to Become Basis for PHP 7

PHPNG is an improved PHP codebase which increases the performance gains anywhere between 20% and 110% in real world applications such as Wordpress, Drupal or SugarCRM. It also significantly reduces memory consumption.

The goal now is to officially accept the new codebase as the basis for the next major version of PHP. Once that happens, we will generally stop referring to phpng as phpng, and will start referring to it only as PHP 7. This upgrade will bring a huge performance improvement to PHP.

2. JIT Engine

According to Dmitry Stogov of Zend, the motivation of starting the development of PHPNG was to research the implementation of a JIT engine for the Zend Engine based PHP. Such an engine can dynamically compile Zend opcodes into native machine code with the result that the code will run faster the next time it is run.

It is certainly likely that a JIT engine will be brought 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 introduction of an Abstract Syntax Tree (AST) as an intermediary structure in PHP compilation process.

As described in his proposals, the two primary advantages of using AST are:
  1. More maintainable parser and compiler and better code quality
  2. No more syntactical decisions due to technical restrictions

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

4. Asynchronous Programming

Facebook Hack provides a very elegant support for asynchronous programming. PHP core developers are also moving fast towards making asynchronous programming available in PHP sooner rather than later.

Recently, Julien Pauli, one of the developers of the latest PHP releases, has been commenting about refactoring PHP I/O multiplexing layer.

This feature would allow future versions of PHP to easily implement support to the execution of parallel tasks within the same request, which will result in pushing performance improvement potential of PHP to the next level.  Of course, we won’t get performance improvements automatically just by enabling the support for asynchronous programming. New PHP code needs to be written to take advantage of its potential.

However, despite the initial effort of Jean Pauli, it is not necessary that asynchronous programming built-in support will be enabled in PHP 7.

5. Standalone Multi-threading Web Server

This feature might not make in PHP 7 version, but it is something that would make PHP more scalable. This feature is already present in HHVM which can be run as a standalone multi-threading Web server. This allows Facebook to reduce the numbers of server machines needed to handle the high traffic load.

Multi-threaded Web servers like ngynx, lighttpd or even Apache in worker mode can be be used to run PHP, 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. It would also allow PHP use a single pool of database connections, thus minimizing the number of simultaneous database connections opened during access peaks.

When will PHP 7 be released?

It is too early to predict the release date of PHP 7. Some people say that it will take around 1 to 3 years. A reasonable guess is to expect a final PHP 7 release some time in 2016, although it is possible that we see an early alpha version before that.

So in conclusion, you will have to wait for at least one year until you can start learning about it.

What do YOU think about PHP 7? What would you like to see happening to the PHP language in future? Let me know through your comments.

Tags: PHP 7 release date, PHP 7 features, PHP 7 improvements

0 comments:

Post a Comment