PHP 5 has been a very important release for the language – it has formalized a lot of the features that before had only a little support, or was perhaps distracted. It was also the first version after PHP 4, which was a rebellion in the language, so it had a great deal to live up to. As a major version, PHP 5 has a lifespan of between three and four years – PHP 4 was officially released on 22nd May 2000 and went through many revisions before being replaced by PHP 5 over four years later.
Between now and PHP 6, we will observe several minor patch releases at first that correct many problems with the original PHP 5 release. With PHP 5.1, whenever it is released, we will see the first big set of new functionality – mostly new functions to use, and new ways of doing things. What is certain is that more and more extensions will be added to the system to allow programmers to take advantage of more and more things in their code.
Already confirmed for PHP 5.1 is the PHP Data Objects extension (PDO), which unifies the various database APIs so that you can just call pdo_query() rather than mysql_query(), pgsql_query(), or any of the others. It won’t replace PEAR::DB because it doesn’t abstract the SQL dialects being used, but it will instead complement PEAR::DB. We’re also expecting big speed improvements in PHP 5.1, and not just in any single area – all sorts of calls, from switch/case statements to the sort() function and class autoloading are all improved.
When it comes to what will be in PHP 6, who knows? Many people have asked that PHP be able to compile down into native instructions for maximum speed, which would certainly keep PHP in the lead when it comes to performance, however it would particularly hard to execute. Another possibility is that code caching be built directly into the language so that products such as PHP Accelerator and Zed Performance Suite are no longer necessary – the language could be made to accept caching simply by toggling a switch in php.ini. It is also possible that some features left out from PHP 5 will finally see the light of day in PHP 6, such as namespaces – only time will tell.
Having said that, there are two features I’d particularly like to see in future releases: multiple dispatch and junctions. Multiple dispatches are the technique of calling a given function on several objects at the same time, and if it were in PHP would look something like this:
$array = array($object1, $object2);
$array->doFunc($para1, $para2, $para3);
That would call the doFunc() method of $object1 and $object2, passing in $para1, $para2, and $para3. Junctions – also called quantum superposition by some Perl hackers – is a new feature in Perl 6 that allows you to assign more than one value to a variable then run circumstances like “if $myvar is any of values A, B, C, or D, then…”. Yes, this is already possible with lots of || operators (or && operators if you want to say “$myvar is all of these values…”). Mmmm… quantum superposition!
With PHP continuing to gain massive support from programmers looking to expand their programming horizon, new versions of the language are likely to be geared towards solidifying its position as opposed to revolutionize. When Perl 6 was being intended, many huge changes were brought that separated a lot of developers – hopefully PHP will not go the same way.
In the interim, be happy that you have chosen such a popular language that is advancing so rapidly – PHP is here to stay, and things are only going to get better!
You must be logged in to post a comment.