Leaner, meaner PHP 7 promises huge performance boost

Language founder Rasmus Lerdorf says lower memory usage provides a 100 percent speedup in most real-world applications

Leaner, meaner PHP 7 promises huge performance boost

PHP 7.0.0, released yesterday after two years in development and eight release candidates, brings with it a doubling of performance said Rasmus Lerdorf, the founder of the language.

In an interview with InfoWorld this week, Lerdorf talked about what to expect from the upgrade to the popular server-side scripting language used in Web development. "On most real-world applications, you'll get a 100 percent speedup," he said. "In theory, you could turn off half the servers in your data center [after the upgrade and still have the same performance as was experienced prior to moving to version 7.0.0]."

Lower memory usage is key to this performance boost. "By shipping less memory around, things go a lot faster," said Lerdorf, who serves as a distinguished engineer at e-commerce vendor Etsy. The upgrade features a multitude of optimizations as well, and its developers worked with Intel to make better use of hash lines and modern CPU features like registers.

Version 7 also includes abstract syntax tree, enabling developers to build tools for static analysis and other purposes. Another feature, scalar typing, boosts coding by "allow[ing] you to prove correctness of your code in advance," said Lerdorf.

"If you have reasonably modern PHP code written in the last 10 years, you should have absolutely no backward-compatibility issues," Lerdorf said. There may be issues with code written prior to that, with PHP builders deprecating some PHP 4 features, such as the ereg library for regular expressions.

Next up for PHP in a future version is a JIT compiler with an optimized engine, said Lerdorf. This could arrive in PHP 7.1 or 7.2, though it may take at least a year.

Lerdorf credits three developers with driving PHP 7 forward: Dmitry Stogov, from Zend; Xinchen Hui, from Lianjia Technologies; and Nikita Popov, a computer science/physics student in Berlin. Lerdorf said he is still involved, though, working on bug fixes and the like. He first developed PHP in 1995 and is surprised at its level of success. "I had absolutely no idea that other people would even use it at all. I built myself a hammer so that I could build dynamic websites quicker."

At Rogue Wave Software, Andi Gutmans, who was CEO of PHP tools vendor Zend until its acquisition by Rogue Wave, lauded today's release in a blog post. "PHP, the most popular Web development language, which runs by some estimates 80 percent of websites, is getting a big step-up in speed."

The previous stable release of PHP was the 5.6 line. PHP developers had been developing a PHP 6 line that used Unicode in its internals, but that project wasn't moving forward. The new line offered today skipped right to the PHP 7 designation to avoid confusion, Lerdorf explained.


Copyright © 2015 IDG Communications, Inc.