Having the ability to overload a constructor would be so hot! Does it have it?

Also, in the Changes in the PHP 5 / Zend Engine 2.0 page, it talks about overloadable method calls. It says

Both method calls and property accesses can be overloaded via the call(), get() and __set() methods

How is that overloading? The example doesn't even address overloaded methods or constructors.

Why would they use __construct() instead of the name of the class like in PHP 4 (or Java/.NET/C++)?

-a9

    No. Having different constructors with different signatured would be tricky to do in a loosely-typed language like PHP. does new Foo($bar) refer to Foo's constructor construct($integer_parameter) or the constructor construct($string_parameter)?

    get() and set() are used to alter the behaviour when you use $foo = $object; or $object = $foo respectively (where $object is the object with the get() and set() methods). It's overloading assignment. $object->call('wibble') is called whenever $object->wibble() is used in the code (whether or not $object has a method called wibble()). You're free to write any code you want in get(), set(), and call(). You could, for example, perform different tasks depending on the types of the arguments passed to those methods.

      Write a Reply...