Re: [PHP4BETA] Child function never get called
| From: | Zeev Suraski | Date: | Tue, 27 Jul 1999 21:53:44 +0000 |
| Subject: | Re: [PHP4BETA] Child function never get called | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-2867@lists.php.net to get a copy of this message | ||
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:-- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.ilThis 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/ For a PGP public key, finger bourbon@netvision.net.il