Re: class constructor overloading
| From: | Jochem Maas | Date: | Thu, 23 Oct 2008 11:57:54 +0000 |
| Subject: | Re: class constructor overloading | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282348@lists.php.net to get a copy of this message | ||
Alain Roger schreef:
> thanks a lot, this is exactly what i needed.
> if the construct of based class A accept arguments, i guess that construct
> of class B must have the sames.
> moreover, i guess that something like that must be written:
I guess you find guessing preferable to RTFM and/or trying code out.
> class A
> {
> function __construct($nameA)
> {
> ...
> }
> }
>
> class B extends A
> {
> function __construct($nameB)
> {
> parent::__construct($nameB);
> }
> }
>
> am i right ?
are you?
>
> thanks.
>
> A.
>