Re: Inheritance-problem
| From: | Martin | Date: | Wed, 09 Aug 2000 12:12:52 +0000 |
| Subject: | Re: Inheritance-problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10907@lists.php.net to get a copy of this message | ||
> Well, since B is really an extension of A, DoSomething() should only be
> defined once because by extending A you're making B a part of the same
> class. In fact, in B, you are redefining DoSomething() and that's why it's
> printing "Class B visited" even when you create a new object of A.
>
> By using the extends keyword you are making class B a part of class A.
.. okay, I tought a kind of "c-ish" ;-)
Someone claimed in the manuel, that it would be possible in PHP4 to use
A:DoSomething() to do it. I haven't try it yet, since to project is until now
written in PHP3.
Regards
Martin