|
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.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
|