PHP 5.1’s Killer Feature?

Share this article

PHP 4 didn’t really catch fire in terms of real-world server support until its first major update, version 4.1. Will the same be true of PHP 5, the first point release of which is now in its early beta stages?

PHP 5.1 Beta 1 has been out for ten days, and Beta 2 has just become available. Neither of these releases has yet been announced on, nor has an official list of changes been posted, but if you’re especially curious you can read the detailed breakdown maintained by the developers.

Upon its release in early 2002, PHP 4.1 made some important changes to the language. It was the first release that recommended register_globals be switched off to improve security. The long-named variables like $HTTP_GET_VARS for accessing submitted values securely were replaced with shorter, more convenient superglobal variables like $_GET. All up, PHP 4.1 almost had a greater impact on the way developers used PHP than the major 4.0 release did.

At this stage, PHP 5.1 is not looking to be quite as spectacular. Some enhancements to Perl regular expressions, a few extra array functions… nothing to write home about. But there is one significant enhancement to PHP in 5.1: PHP Data Objects (PDO).

The PDO library lets you access any of an extensive selection of supported databases using a signle set of functions. So not only do you only need to learn one set of functions to write for multiple databases, but you can transition an application to another database without having to change all the functions throughout your code.

PHP developers have been achieving this for years using database abstraction layers, at first homegrown, then open source, and finally official. This is the first time such an abstraction layer will be completely built into PHP, and not a layer of PHP code sitting on top of it, however.

Could this be the killer feature that draws developers to PHP 5.1 when real-world adoption of PHP 5 is still lagging? If you feel like trying out PDO to decide for yourself, a good place to start is the lead developer’s blog.

Kevin YankKevin Yank
View Author

Kevin Yank is an accomplished web developer, speaker, trainer and author of Build Your Own Database Driven Website Using PHP & MySQL and Co-Author of Simply JavaScript and Everything You Know About CSS is Wrong! Kevin loves to share his wealth of knowledge and it didn't stop at books, he's also the course instructor to 3 online courses in web development. Currently Kevin is the Director of Front End Engineering at Culture Amp.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form