Re: constructors in PHP
| From: | André Medeiros | Date: | Mon, 11 Jul 2005 16:01:45 +0000 |
| Subject: | Re: constructors in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218444@lists.php.net to get a copy of this message | ||
On Mon, 2005-07-11 at 16:44 +0200, Alessandro Rosa wrote:
> Is there the possibility to have in PHP multiple class constructors
> as in C++ or just one ?
> I would be sure about it in order to prevent useless mad investigations
> in the code I'm writing.
>
> Thanks in advance ...
>
> Alessandro Rosa
You can't make several definitions of constructors. What you _CAN_ do is
to use func_get_args ( www.php.net/func_get_args ) to determine how many
args were passed :)