X
Business

Latest PHP improves XML integration

Builder UK: PHP5 includes a new object model and memory manager
Written by Jonathan Bennett, Contributor

The latest version of PHP has a range of new features designed to improve performance and scalability, as well as improve integration with common Internet standards.

PHP is an embedded Web scripting system often employed with other open-source technologies such as the Apache Web server and the MySQL database to create dynamic, data-driven Web sites. Around 16 million domains use PHP, although many of these are based at shared hosting facilities, reflecting its typical use in smaller scale projects.

The new object model in PHP5 now passes objects by reference, rather than by copying. This should make most PHP applications run faster, since fewer memory accesses are needed. This also means even existing PHP applications should run faster without the need to rewrite code.

A new memory manager, designed to work better in multi-threaded environments, has been incorporated into PHP5. The improvements in coding for PHP come from an updated version of the Zend engine, the interpreter behind PHP. Improvements include a proper exceptions mechanism, a reflection API, static classes and methods, finalisation of classes and methods.

The Zend II engine, named after PHP's creators, Zeev Suraski and Andi Gutmans, has been developed by Zend Technologies Ltd., a company the two set up to offer commercial products based around PHP. PHP itself remains an open-source project under the auspices of the Apache Foundation, with the Zend engine itself being available under a BSD-style licence.

The latest version also features improved integration with XML and Web services. While PHP extensions supporting XML documents have been available for a while, they've either been buggy, non-compliant with official standards, or both.

The new extensions, bundled with the standard PHP distribution, are much more stable and follow World Wide Web Consortium (W3C) recommendations. This enables PHP to compete better with the latest Web development tools from commercial vendors, including Microsoft's .Net platform, and brings PHP up to par with true object-oriented languages such as Java.

PHP is considered easier to deploy than Java or C-based applications since the code is embedded directly into Web pages. The Web's other popular scripting language, Perl, has had pseudo-object orientation for a while, but a true OO version of the language will only come with Perl 6, which is still in development.

PHP is used by some larger Web sites as an application framework, but has traditionally lacked the power of a full-blown development language, and has suffered from a reputation for slow performance. This hasn't stopped it being used for some major projects -- Builder UK uses PHP in its content management system, for instance.

Editorial standards