Why there is no cunstructor overloading in PHP
Posted: Tue Feb 03, 2009 5:03 am
Hi all,
I know that there is no constructor overloading as it is in the other OO languages as C++ or Java. I know how we can simulate overloading and some tricks to deal with that situation. But my question is not how to deal with that but why there is no constructor overloading? What is the reason for that. I suppose that the reason is because the interpreter is unable to determine the appropriate constructor to use only by the type and the number of the parameters. Any ideas?
Thanks.
I know that there is no constructor overloading as it is in the other OO languages as C++ or Java. I know how we can simulate overloading and some tricks to deal with that situation. But my question is not how to deal with that but why there is no constructor overloading? What is the reason for that. I suppose that the reason is because the interpreter is unable to determine the appropriate constructor to use only by the type and the number of the parameters. Any ideas?
Thanks.