HomePHP Page 3 - PHP 5: A Sign that PHP Could Soon be Owned by Sun
New Features in PHP5 - PHP
PHP 5ís official release occurred on July 13th with a complete re-haul of object-oriented programming features and improved MySQL functions. These are sure to be great additions to the package for PHP developers. However, many of the changes to PHP are hinting to something that may not necessarily be something PHP developers will like down the road.
Some very useful functions have been added to PHP5. Itís been nine years in the making, but PHP5 now includes two functions to uuencode and uudecode. Combining those functions with the new socket and stream functions, developers can create a lots of "kewl" applications. An application to automatically encode and decode files to and from news servers comes to mind as an example of how to incorporate these new functions. At that point of course, a developer could use any of PHPís existing functions to continue to manipulate the files, store the contents in databases, and so on. Read about those and all the other new functions at: http://www.php.net/manual/en/migration5.functions.php.
An addition to error reporting aids developers in keeping their code up-to-date. The E_STRICT message tells developers when their code is using deprecated functions or is in danger of not being forward compatible. However, donít assume that E_STRICT will be output if using E_ALL, because it wonít. E_STRICT must be explicitly declared to output its suggestions to PHP 5 code.
While the rewriting of PHPís object model to essentially that of the Java object model does raise flags about the direction of PHP, it is still a powerful addition to the PHP5 release. Java became successful for a reason. Itís intelligently designed and facilitates code reuse. By borrowing the best features of Javaís object model, PHP has leveraged itself with far more credibility as a programming language that can stand on its own two feet (even if Sun, Borland and Macromedia are holding it by its arms).
Some vital re-workings in the PHP object model lie in how objects are treated in low-level fashion. Instead of passing the actual object itself, PHPís object model passes by reference. Now when operating on objects, developers can pass around multiple handles to the actual object allowing for more powerful and efficient applications. Existing PHP objects do not need to be re-written to take advantage of this change in PHP 5.
In general, developerís who have experience with Java will easily adapt to PHP 5ís object model. On the downside, if PHP is a developerís primary language and he or she hasnít been introduced to the world of static variables, public and private methods and the host of aspects included with this new model, they may have a bit of a learning curve adopting the higher-level format of object-oriented programming in this release. Overall, though, this change will be a plus for creating large-scale, object-oriented applications with PHP.