RealTime IT News

PHP 5.3 Accelerates PHP

The open source PHP language is seeing its first major update in two years courtesy of today's release of PHP 5.3, along with a long list of new features designed to expand its capabilities and accelerate performance.

The PHP 5.3 release is a bigger release than developers first intended, and takes on some features that were originally intended for PHP 6. The new release also comes as the open source language continues to face competitive challenges from multiple technologies including Ruby, Java and .net.

"I think that the 5.3 release ended up being much more comprehensive in terms of new features and functionality then anyone had envisioned, largely due to the delay of PHP 6," PHP developer Ilia Alshanetsky told InternetNews.com. "Therefore it took quite a bit of time to release, much longer, then I think anyone had anticipated for it to take. That said, I think the extra time was well worth it and 5.3.0 is a very impressive work by many developers."

"As is usual for most substantial PHP releases, this version introduces a number of enhancements that make it possible to develop applications easier, making solving problems with PHP that much simpler," said Alshanetsky, an active core developer of the PHP language and the release master for the previous PHP 5.2 release.

One of the ways that PHP 5.3 will make application development easier is with the new namespace support, which is a way to encapsulate classes and other PHP items.

Alshanetsky said that in his view, namespaces will allow for cleaner code and simpler naming conventions for PHP developers.

"At the present time, most library authors are forced to prefix their class and function names with the library names to avoid naming conflicts, which sometimes creates rather unwieldy names," Alshanetsky said. "This also should simplify utilization of multiple libraries that don't necessary follow careful naming conventions of prefixing their class/function names within a single application."

MySQL

PHP is often used in tandem with the MySQL open source database as part of the LAMP (Linux/Apache/MySQL/PHP) stack for Web applications. PHP 5.3 adds in a new feature called MySQLInd that replaces for the current libmysql library for connecting PHP with MySQL and holds the potential to optimize MySQL performance and memory utilization.

"When it comes to databases, in most cases the speed of the interface to the database is not the main bottleneck -- rather, the database operation are," Alshanetsky said. "There are definitely speed improvements of using MySQLInd over the standard libmysql, however I doubt that would substantially speed up most applications. That said people with highly tuned MySQL applications may see improvement, due to faster, specialized interface."

Overall, Alshanetsky expects that with PHP 5.3, users should see a modest 5 to 15 percent performance increase in most workflows, compared to the current 5.2 release. He added that some specialized workflows may see even higher benefits.

E_DEPRECATED

While adding new features is a key part of any new technology release, PHP 5.3 also does something different -- it makes it clearer which features may soon be disappearing.

The release provides for a new error code called E_DEPRECATED, which lets developers know where certainly functionality is set to be removed from the language.

"One of the issues we've had before is that we didn't have an explicit error code for deprecated functionality and may have been difficult for people on an error-code level to determine what functionality may eventually be removed," Alshanetsky said.

"By creating a dedicated error code for this, it would make it easy through the use of PHP's error-logging facility to identify which aspects of your code base are using functionality that may eventually be removed, so that they can make the appropriate adjustments."

The ability to mark features as being up for removal in a future version of PHP is coming as core PHP development continues on PHP 6, the next evolution of the PHP language. The PHP 5.x series has been available since 2004.

"The general consensus of the PHP's development team is many things currently marked as E_DEPRECATED will be removed in PHP 6, so making things that are about to go away very apparent is very important," Alshanetsky said.