Re: calling parent class method from the outside

From: Date: Mon, 02 Jul 2007 19:59:01 +0000
Subject: Re: calling parent class method from the outside
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-258055@lists.php.net to get a copy of this message
admin wrote: > Once again, calling the parent version of a method "externally" is > allowed in C++ (and whoever said it was bad design should speak up to > Bjarne Stroustrup ;-)) Any such trick in PHP? I stand suitably corrected :) I didn't realise you could do that in C++ to be honest. I'm trying to think of a use of this feature in my many C++ programs but can't think of a practical use of such a feature. I guess I'll have to think differently when designing things but I can't help but think that one of the major advantages of deriving classes is the extension and abstraction of your models. If I can pick and choose which parent's implementation of a given method is used then it could totally change how the classes are supposed to function. I guess you can make the parent methods protected but but would have other negative trade offs. Ach, I'll have to go and dig out my old notes from Uni. /me misses programming in C++ :(

« previous php.general (#258055) next »