PHP 8 programming language: new JIT compiler aims for better performance

Hi, Habr. Future students PHP developer course and all those interested are invited to take part in open webinar on “PHP 8 – What’s New?”

And now we are sharing a traditional translation of interesting material.


A senior Google database expert loves the JIT compiler, but others question its value and say it’s difficult to maintain.

The team that created the PHP scripting language announced PHP 8.0 – a major release that may require developers to check the code for breaking changes.

This version of 25-year-old PHP introduces an improved type system, a new JIT compiler in the PHP engine, and some features borrowed from Python and JavaScript such as named arguments and null safe operators.

PHP as a language has not found universal love, but it is widely used by web developers. Developers rate PHP as the sixth “worst” language in Stack Overflow Developer Survey 2020but it also turned out to be the eighth most popular language.

Developer Analyst RedMonk is currently positioning PHP as fourth most popular languagesecond only to Java, Python and JavaScript. Tiobe Software ranks PHP 8th… And, according to Indeed, the number of entry-level PHP developer job postings over the past year increased by more than 800%

PHP is backed by the core PHP development team and Zend, a US-based PHP development consulting company founded by Andy Guttmans, general manager and vice president of database development at Google. Gutmans said he was “delighted” with the JIT compiler

The JIT compiler is designed to improve the performance of web applications. However, Brent Roose, a Belgian developer stitcher.io, said he has a gripe when it comes to inquiries.

Like an interpreted language such as JavaScript and Python, PHP code is translated at runtime. It is not a compiled language like C, Java or Rust and needs to be translated for the CPU to understand the PHP code.

“A JIT compiler can dramatically improve the performance of your program, but getting it right is difficult.” noted Roose

The pros of a JIT compiler are that it can make PHP a better language to use offline, but it can make it difficult to debug code in the compiler. Roose noted that in the event of a bug, PHP users will be dependent on the JIT compiler maintainers, which could mean slower fixes for security and bugs.

“Since today only a few people can maintain the codebase [PHP], the question of whether it is possible to maintain a JIT compiler in a proper way seems to be justified. Of course, people can figure out how the compiler works. But whatever one may say, this is difficult material, ”said Roose.

He hesitates whether to include a compiler in PHP due to maintenance costs. He also said that PHP users should “be aware that some bug fixes or version upgrades may take longer than what we have come to expect today.”

In addition, releasing PHP 8 as a major release may mean that old PHP code may not work after an upgrade. However Roose noted that most of the breaking changes deprecated before 7.x.

Zend also posted a reminder that the lifecycle PHP 7.2 is coming to an end thirty November 2020, which means that major PHP contributors will no longer offer security patches for this version, which could create problems for enterprise web applications.

But PHP users can always pay a consulting firm like Zend for long-term support and they’ll get patches after November 30th.

“For operating system users with long-term support offerings, their PHP binaries often continue to receive patches from the OS vendor even after the community support period ends,” said Matthew Weier O’Finnie, engineer at Zend.

“In the case of Ubuntu 18.04 and RHEL / CentOS 8, each of which ships with PHP 7.2, this means you can keep getting patches. However, if the operating system you are running on is not under LTS policy, then your version will eventually become vulnerable to new exploits. “

Mark Storey, Sentry Lead Developer, which maintains PHP projects CakePHP and XHGui, said PHP 8 named parameters and union types provide usability and correctness improvements.

Named parameters allow methods to be called with parameters based on their name, not just their order, Story explained.

“Named parameters help to simplify the use of calling methods that have many optional parameters because you can only specify the parameters you use by name,” he told ZDNet.

“It will also help improve the readability of your code in the future, since remembering which method parameter six is ​​more difficult than figuring out what the expires parameter can do.”

Meanwhile, union types extend PHP’s type system.


Learn more about the course “PHP developer”.

Register for the open webinar on the topic “PHP 8 – What’s New?”

Right now, OTUS has the maximum New Year discounts for all courses. You can see the full list of courses at the link below. Also, everyone has a unique opportunity to send to the addressee gift certificate for training at OTUS

By the way, about the “beautiful packaging” of online certificates, we we tell in this article

GET A DISCOUNT

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *