Re: [PHP4BETA] Child function never get called
| From: | Johan Isacsson | Date: | Wed, 28 Jul 1999 07:25:25 +0000 |
| Subject: | Re: [PHP4BETA] Child function never get called | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-2888@lists.php.net to get a copy of this message | ||
My fisr message never got through i think... Sorry if it did cause here it
comes again in that case :P
Yeah, it's nested in an if statement (all includes are nested in an if so
they dont get parsed twice in case i happen to include them again). I
managed to solve the problem by include first the parent class then the
child class in the "phtml" document that used them, previously i just
included the child class and the child class in turn included the parent
calss. Well, seems like that should work now anyway, how do i get the CVS
version? I'd be happy to help you find bugs and stuff (i'm doing a rather
complex thing that uses alot of oo so i might find some :P).
Thanks, Johan Isacsson
On Tue, 27 Jul 1999, Zeev Suraski wrote:
> As a matter of fact, there's a good chance it was my fault after all (well
> over 99% isn't always 100% :)
>
> In case your class definitions were nested inside an IF statement, or a
> function, or inherited from a class definition that was in an IF statement
> or a function or even an include file, inheritance was not being performed
> correctly.
>
> This is fixed in the latest CVS!
>
> Sorry,
>
> Zeev
>
> At 01:58 27/07/99 , Johan Isacsson wrote:
> >I started out preparing the code that i was to send to you and (surprise)
> >all of a sudden it worked...
> >
> >So there must be some mysterious error sneaking around somewhere in the
> >include files i removed from the example...
> >
> >Anyway, sorry that i've bothered you with something that was my problem
> >rather than yours...
> >
> >Thanks, Johan Isacsson
> >
> >On Tue, 27 Jul 1999, Zeev Suraski wrote:
> >
> > > At 00:58 27/07/99 , Johan Isacsson wrote:
> > > >This is strange, the example i gave you actually echoes 2...
> > > >But in the real program which is a bit more complex, it dont work, the
> > > >child function dont get called. I saw some cvs info about iheritance with
> > > >included files, all my classes are separate includes, could that have
> > > >something to do with it? In that case, is it possible to get it? I would
> > > >really need it :)
> > >
> > > The problem you're describing sounds extremely weird, I can't really see
> > > how it may happen. The problem with classes and include files under some
> > > circumstances was a 'fatal' one, i.e., your script wouldn't work at
> > > all
> > > under some conditions. It's fixed now.
> > >
> > > However, that should have no affect on what you're describing. Right now,
> > > the only known bug we're aware of is that child constructors, if not
> > > explicitly written, default to their parent's constructor (which is the
> > PHP
> > > 3.0 behavior).
> > >
> > > I'm pretty sure that what you're describing, the way you're describing
> > > it,
> > > can't happen. An object instanciated for a given class will use the
> > > function table for that given class, and not for that class's parent. I
> > > could be wrong of course, but I'm over 99% certain.
> > >
> > > If you have an example that reproduces the problem, try to cut it down as
> > > much as you can (cutting it down, as opposed to writing an test case from
> > > scratch, may take a bit more time, but will be easier on the long run),
> > and
> > > send it to us. If you can't cut it down at all, send it to us the way it
> > > is, just so that we can see what's going on. No matter how complex the
> > > script is, testing what happens when a new object is instanciated is
> > fairly
> > > easy for us.
> > >
> > > Thanks,
> > >
> > > Zeev
> > > --
> > > Zeev Suraski <zeev@zend.com> http://www.zend.com/¢¯þ1‘
> > > Åd.¿�=öY™
> > > For a PGP public key, finger bourbon@netvision.net.il
> > >
> > >
>
> --
> Zeev Suraski <zeev@zend.com> http://www.zend.com/
> For a PGP public key, finger bourbon@netvision.net.il
>
>