Re: class constructor overloading
| From: | David Otton | Date: | Thu, 23 Oct 2008 08:19:24 +0000 |
| Subject: | Re: class constructor overloading | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282334@lists.php.net to get a copy of this message | ||
2008/10/23 Alain Roger <raf.news@gmail.com>:
> 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";
parent::__construct();
}
}
$B = new B();
--
http://www.otton.org/