Home arrow PHP arrow 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.

TABLE OF CONTENTS:
  1. PHP 5: A Sign that PHP Could Soon be Owned by Sun
  2. How PHP5 is Similar to Java
  3. New Features in PHP5
  4. MySQL Functions in PHP5
  5. Questions About the Future Direction of PHP
By: Ian Felton
Rating: starstarstarstarstar / 180
August 04, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

On the positive side, this edition of PHP does bring improved performance and a new suite of MySQL functions. Backward incompatibility is limited to a list of ten issues that can be found at: http://www.php.net/manual/en/migration5.incompatible.php. Minimally, there are only minor configuration file changes that need to be made to the web server. These changes are found at: http://www.php.net/manual/en/migration5.configuration.php. Several directives have been introduced for configuring php.ini files mainly dealing with hashes for encryption. Read about them at http://www.php.net/manual/en/migration5.newconf.php.

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.



 
 
>>> More PHP Articles          >>> More By Ian Felton
 

blog comments powered by Disqus
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 



© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap

Dev Shed Tutorial Topics: