The team behind scripting language PHP has announced PHP version 8.0, a major release that may require developers to review code for any 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 isn’t particularly liked as a language but it is widely used among web developers. Developers rank PHP as the sixth ‘most dreaded’ language in Stack Overflow’s 2020 developer survey, but it also emerges as the eighth most commonly used language.

SEE: Hiring Kit: Python developer (TechRepublic Premium)

Developer analyst RedMonk currently positions PHP as the fourth most popular language, only behind Java, Python and JavaScript. Tiobe Software puts PHP in eighth place. And, according to job search engine Indeed, job postings for entry-level PHP developer roles have increased over 800% in the past year.

PHP is maintained by the PHP core development team and Zend, a US-based PHP-focused development consultancy co-founded by Andi Gutmans, general manager and vice president of databases engineering at Google. Gutmans says he’s “excited” about the just-in-time (JIT) compiler.

The JIT compiler is meant to bring performance improvements to web applications. However, Brent Roose, a Belgian developer behind, says it doesn’t necessarily deliver when it comes to web requests.

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

“A JIT compiler may improve the performance of your program significantly, but it’s a difficult thing to get right,” notes Roose.

The pros of having a JIT compiler is that it could make PHP a better language for use outside the web, but it could make it more difficult to debug code in the compiler. Roose notes that if there is a bug, users of PHP will depend on the maintainers of the JIT compiler, which could mean slower security patches and bug fixes.

“With just a few people being able to maintain [the PHP] code base today, the question whether the JIT compiler can be maintained properly seems justified. Of course, people can learn how the compiler works. But it is complex material nevertheless,” says Roose.

He questions whether the compiler should be included in PHP due to the cost of maintenance. He also says that PHP users should “be aware that some bugfixes or version updates might take longer than what we’re used to right now”.

Additionally, PHP 8 as a major release may mean older PHP code could be broken after upgrading. However, Roose notes that most of the breaking changes were deprecated before the 7.x versions.

Zend has also posted a reminder that PHP 7.2 is reaching end of life on November 30, 2020 and that means PHP core contributors won’t be offering security fixes for that version of PHP anymore, which could spell trouble for enterprise web applications.

SEE: Programming languages: Julia users most likely to defect to Python for data science

But PHP users can always pay a consultancy like Zend for long-term support and they will get patches after November 30.

“For users of operating systems with long-term support offerings, your PHP binary often continues to receive patches by the OS vendor even once the community support window has ended,” says Matthew Weier O’Phinney, an engineer at Zend.

“In the case of Ubuntu 18.04 and RHEL/CentOS 8, which each ship with PHP 7.2, this means you may continue to get patches going forwards. If the operating system you are on is not under an LTS policy, however, then your version will become vulnerable to new exploits as time progresses.”

More on PHP and programming languages

Source link


Please enter your comment!
Please enter your name here