PHP coming of age
This article, although old, is a very nice roundup of new features in PHP5:
- Real object orientation, with full inheritance, working constructors/destructors, delegations, private fields, interfaces, abstract classes, namespaces...
- Exceptions (yay!)
- XML support is part of core PHP (XML support means: a parser, a DOM API and an XSLT transformer)
- SQLite. SQLite is an embedded database, excellent for transient data that shouldn't be commited to the entreprise database. It'll be a core PHP feature. It isn't ACID compliant or anything like that, but it understands SQL and is fast for small operations (think mysql, but faster and smaller).
- Dereferencing! This is a rant of mine... This code will work in PHP5 (stupidly, it doesn't in PHP4):
(new Foo())->makeSausages();
- Autoloading. A method of avoiding the parse of every class of an application, instead of just the ones being used to service the current request (really excellent hindisight, as good OO will cause an explosion in the number of classes used by any given app).
- Type hinting. This is a strange feature for a scripting language, but I guess its the cross-breed of untyped and typed languages providing the best of both worlds. Now, in PHP, developers can enforce parameter types (they may choose not to).
- The Streams API. This is just the extension to all I/O operations of the streams concept, previously found in the f* functions. Now it's relatively easy to implement new streams, which can be immediatly used with the f* functions.

