Re: calling a overwritten method???
| From: | Markus Fischer | Date: | Wed, 23 May 2001 13:55:08 +0000 |
| Subject: | Re: calling a overwritten method??? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-161@lists.php.net to get a copy of this message | ||
On Wed, May 23, 2001 at 03:45:06PM +0200, Wolfram Kriesing wrote :
> > > class A
> > > {
> > > function go()
> > > {
> > > // do one thing
> > > }
> > > }
> > >
> > > class B extends A
> > > {
> > > function go()
> > > {
> > > // call the parent's method ---- HOW
> > > // do another thing, additionally
> >
> > A::go();
> >
> >
> > > }
> > > }
>
> but what if (in class B) i need to call this instance's parent method?
> Because there might be some internal variables set or something!
>
> then i would need something like $this->parent_go in class B or is that
> also somehow possible with the :: ?
>
I was asking this myself, too. A::go() AFAIk just calls it like a
static method. Or does PHP know which classes are the parents and
treat them in another way ?
- Markus