25 The future of PHPThis is NOT the latest copy of this book; click here for the latest version.
Now that you have finished learning all about PHP 5, you are likely wondering what the development group can do next - where is PHP headed in the next six months, one year, or even three years?
PHP 5 has been a very significant release for the language - it has formalised a lot of the features that before had only a little support, or were perhaps ill-defined. It was also the first version after PHP 4, which was a revolution 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 see 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 Zend 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 dispatch is 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($param1, $param2, $param3);
That would call the doFunc() method of $object1 and $object2, passing in $param1, $param2, and $param3. 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 conditions 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 revolutionising. When Perl 6 was being designed, many huge changes were brought that alienated a lot of developers - hopefully PHP will not go the same way.
In the meantime, be happy that you have chosen such a popular language that is advancing so quickly - PHP is here to stay, and things are only going to get better!
Chapter contents25.1. Helping out PHP development
25.2. Choosing an ISP
25.2.1. Does your ISP support PHP?
25.3. Optimisation summary
|
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.
My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!
|