Re: [PHP] class constructor overloading

2008-10-23 Thread Christoph Boget
>> is it possible to overload the class construct(or) ? >> if yes, how ? No, it's not. > class A > { >function __construct() >{ >echo "A"; >} > } > > class B extends A > { >function __construct() >{ >echo "B"; >

Re: [PHP] class constructor overloading

2008-10-23 Thread Jochem Maas
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 tryin

Re: [PHP] class constructor overloading

2008-10-23 Thread David Otton
2008/10/23 Alain Roger <[EMAIL PROTECTED]>: > 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. No, you can change the signature of a method when you overload it. Below, B::__construct() accep

Re: [PHP] class constructor overloading

2008-10-23 Thread Jim Lucas
Alain Roger wrote: 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: class A { function __construct($nameA) { ... } } class

Re: [PHP] class constructor overloading

2008-10-23 Thread Alain Roger
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: class A { function __construct($nameA) { ... } } class B extends A { funct

Re: [PHP] class constructor overloading

2008-10-23 Thread David Otton
2008/10/23 Alain Roger <[EMAIL PROTECTED]>: > is it possible to overload the class construct(or) ? > if yes, how ? class A { function __construct() { echo "A"; } } class B extends A { function __construct() { echo "B";