Return to site

What to Expect in PHP 8: New Features & Updates

· Web Development

PHP:Hypertext Preprocessor was initially planned as a small open source project which gradually evolved after individuals started realising its underlying potential. Rasmus Lerdorf, a Danish-Canadian programmer,was the pioneer who unveiled the first version of PHP. Needless to say PHP, embedded in HTML, is a server-side scripting language with immense popularity and fandom.

PHP supports a vast number of major protocols like IMAP, POP3, and LDAP. After enabling n-tier development a possibility for the first time, PHP4 included support for Java and distributed object architecture (CORBA and COM). One may find that PHP is a forgiving language which tries to be as 'forgiving' as possible.

Every language, huge or new, requires to be updated now and then. Coming to PHP 8, the expectations of its users' have skyrocketed already. And, there is one thing users want to see in PHP 8 is to have more real-time features.

Previous known major release of PHP was 7.0.0. It was a huge leap and a milestone that had a considerably improved performance and lower memory usage. Since the advent of 7.0 , we have seen two releases adding more features, one in 7.1 in 2016 and 7.2 in 2017.

The official release of PHP 8.0 is not yet scheduled, the statement has not been made official yet. It is safe to say that since it is a major leap, it can take some more time. According to a few speculations, the release of PHP 8.0.0 is scheduled to be in September 2021.

Compilation of PHP Programs

As we know, PHP comes packed with a virtual machine called Zend VM. The semantic get compiled into instructions, which are called opcodes that are understandable to the virtual machine. These Opcodes are low-level making them faster to translate to machine code when compared to the original PHP code. This is the stage called compile time. Finally, these opcodes then get executed by the Zend VM in the runtime stage.

A major news is that JIT is being implemented as an almost independent part of OPcache, come PHP 8. It will be an extension to cache the opcodes so that compilation does not happen unproductively and is carried out only when it is required. From the latest version of PHP, JIT will treat the instructions generated for the Zend VM as the intermediate representation.

This will in return generate an architecture dependent machine code making CPU directly the host of your code and no longer the Zend VM.

What is JIT? (Just-In-Time Compilation)

Speaking in terms of computational language, JIT is a simple process or way of executing computer code where the compilation is done at the time of the execution of a program, meaning at the run time and not before the execution. This is what we call a just-in-time (JIT) compilation. It is also known as dynamic translation or run-time compilations.

As a process, it carries source code or bytecode translation to machine code, which is then further executed directly. If a system has been integrated with a JIT compiler, the system perennially analyses the code that is being executed.

Another benefit is that it identifies parts of the code where the boost that is gained from recompilation or compilation would usually outweigh the overhead of compiling that code.

Where does JIT stand today in PHP?

According to various sources, Zend has already started its development of a new JIT Engine which is likely to be included with the major version update i.e. PHP 8.0, soon after the Engine is ready and tested.

Zend had said that they want to deliver some extremely useful features in the next major update. One thing to notice here is that when PHP 7 was released, it had major performance improvement over its predecessor, PHP 5. Many experts saw little scope of improvement in performance for the next major update.

The engine development for JIT had started way back when its initial implementation was hindered due to unforeseen technical reasons. Fortunately, the implementation has resumed.

Why JIT?

Developed and used heavily by Facebook today, HHVM or HipHop Virtual Machine is an open-source virtual machine based on just-in-time compilation. It serves as an execution engine for the Hack programming language and is extensively used to support PHP execution before the release of HHVM version 4.

Pertaining to HHVM’s extreme popularity and high demand from the PHP community across the globe, it was time to go for JIT Engine again. Zend and PHP Group are all game for it and determined to bring it up in the next major release PHP 8.0.

End Note

PHP comes with every Linux system and runs on Windows web servers as well. Undoubtedly, this language is likely to stay in the web-building ecosystem for quite some time, more than you and me maybe. Time to hire PHP developer?

According to Netcraft’s monthly web survey, the language’s presence is split mostly between Nginx web servers (29 percent), Microsoft (19 percent), and Apache (29 percent).

All Posts
×

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly