PHP 5.3 Gets A Bit More Object Oriented And More

PHP 5 in general has been a good improvement over PHP 4, but those used to full blown object oriented program languages such as Java or C# may find some OO features still lacking in PHP 5.

PHP 5 has the usual things, such as classes, interfaces, abstract classes, inheritance, etc, but some useful programming constructs have been missing, though PHP 6, under development, aims to rectify that.

However, it seems that many of those features are going to be brought forward to the up-coming PHP 5.3 (which may make it more likely that it will get installed by web hosting companies sooner than they would likely go for PHP 6).

Sitepoint has an excellent summary of the features. The list of features include:

  • Namespaces
  • The use keyword to use namespaces!
  • Namespace aliases
  • Class constants
  • Namespaced functions
  • The Global namespace
  • Autoloading namespaced classes
  • Late static binding
  • Variable static calls
  • MySQL native driver
  • Additional OpenSSL functions
  • Improved command line parameter support
  • XSLT profiling
  • New Error Levels
  • and more…

But visit the sitepoint article for more details.

If you want, there are PHP snapshot builds of PHP 5.3 (and 6.0).

(Those of you that have never coded in PHP may be surprised to see some of these features only surface now, yet, PHP has still managed to drive some of the biggest web sites out there…! I have only used it for about a year myself, in spare time, but it seems quite powerful even without these things. Can’t knock it too much then, I guess 🙂 )

The native MySQL driver will be a good boost for performance, and I will be looking forward to the XSLT profiling in code, while namespaces will be an obvious winner too.

But a lot of PHP programmers are often using it for small scripts and may not often need or want the full power of an OO language. Personally, I prefer OO, so am looking forward to this. Do you use PHP? If so, do you prefer the OO approach and like what is coming?

3 thoughts on “PHP 5.3 Gets A Bit More Object Oriented And More

  1. Pingback: XSLT Profilers — onenaught.com

Comments are closed.