note 53386 deleted from language.oop5.decon by felipe
| From: | felipe@php.net | Date: | Mon, 24 Mar 2008 22:45:48 +0000 |
| Subject: | note 53386 deleted from language.oop5.decon by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137510@lists.php.net to get a copy of this message | ||
Note Submitter: kida at keymail dot it
----
Well:
class A
{
public function __construct()
{
//do something
}
}
class B extends A
{
protected function __construct()
{
parent::__construct();
}
}
You can't make this becouse B::__construct() MUST have the same visibility or a weaker
visibility of A::__construct() !!??!!
SO I THINK it's better
class A
{
public function A()
{
//do something
}
}
class B extends A
{
protected function B()
{
parent::A();
}
}
Because it works. Instead of what they're saying ;)