Re: default and another constructor
| From: | Michal Migurski | Date: | Wed, 12 May 2004 14:12:07 +0000 |
| Subject: | Re: default and another constructor | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185995@lists.php.net to get a copy of this message | ||
> No, you cannot do this kind of method overloading, not like this anyway.
> If you are using PHP5 you can kind of emulate overloading by using the
> __call() function... some googling will find examples.
>
> You can at least make the below work by removing the first forum()
> instance and using
>
> function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
Another option, if you wish to have varying argument lists, is to define
the methods with no arguments at all, and use the func_get_args(),
func_num_args(), and func_get_arg() functions described here:
http://php.net/manual/en/ref.funchand.php
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html