Re: parent::construct not reliable working on php5.1 b2/b3

From: Date: Wed, 03 Aug 2005 08:38:37 +0000
Subject: Re: parent::construct not reliable working on php5.1 b2/b3
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-219885@lists.php.net to get a copy of this message
Am 03.08.2005 um 09:22 schrieb Jochem Maas:
Meno Abels wrote:
Thanks, the problem with cut an paste i have not only one of these messages i get huge amounts of these. So i stripped down to one, sorry my fault. a) usally 4-6
any given class will never have a variable number of parents ;-) IMHO 6 levels deep is pushing the boat out a bit - but technically it should be no problem
depends on the application
b) no c) yes, as I mentioned i tried both (old/new)
again it may sound stupid but double check spelling in the file. also check for weird non-printing chars in the problem file -
there are is alot of code which works as i mentioned all the code is generated. The pattern of the working code is not different to the none working. Also i have some examples where i call the same class in other scripts and they are working. So there is no write error. Also the old syntax should work without change and php 4 it works perfect.
d) never tested i jump over 5.0
5.1 is still beta - test it on 5.0 (consider that the mailing list equivelant of a military order ;-)
that will take a while to do
does the problem occur in only 1 baseclass? or in a fixed number of baseclasses? or is does it occur anywhere/everywhere.
i occurs with a random pattern
are you trying to reassign $this or are you using the reference token (&) when passing objects around? (I ask because you seem to indicate that the codebase is being moved from php4 where such things are almost required to make usuable OO code - whereas in php5 it's asking for trouble)
NO not used!
pump up error_reporting to full i.e. error_reporting( E_ALL | E_STRICT ) - maybe it will give you a hint.
DONE, i see nothing which is seams to be helpfull
also you might consider placing a call to debug_print_backtrace() in each and every constructor to help see wtf is going on.
i'am not clear what is should help for.
lastly get a copy of Zend Studio Client/Server and set it up so that you can do step by step debugging to see _exactly_ what is going on.
-:)
I'm running out of ideas here ... I can only suggest now to post code - and plenty of it - if that is possible, send a link to somewhere rather than bombard everyone on the list with 1000's of lines of code.
i will work to strip down you can't run the code without 20 own written c++/c extentions.
the problem with the code is currently the problem only occures in the real application which as about 20000 lines of code. I tried to stripped down but there was not success. So I ask about how could i work out an idea from the php source to find these problem. I'am pretty sure that i done everything rightly in my application code. It works perfectly with the old-style and php 4.x and i converted all to the new style which is easy of course it is generated php source code so there is not really a general fault possible. If the generator works-:)
that last IF is a big one though!
your questions aren't silly
I know that ;-) I was just trying to make sure you didn't feel as if I was talking down to you :-)
you are welcome
meno Am 02.08.2005 um 23:34 schrieb Jochem Maas:
Meno Abels wrote:
it is only a typo in my email i use __construct
ok - I would recommend cut-n-paste for this kind of output to prevent idiots like me pointing out you typos and to avoid confusion in general. the next questions would be: a, how many parents does the problem class (Link or Links?) have? b, is Rank the base class? c, does Rank::__construct() actually exist? d, does the error also occur with php5.0.x? (as apposed to php5.1beta) given these questions may seem silly - but I can't see your code from here :-) so I figured I'd ask anyway!
Meno 2005/8/2, Jochem Maas <jochem@iamjochem.com>:
Pawel Bernat wrote:
On Tue, Aug 02, 2005 at 03:42:00PM +0100, Meno Abels wrote:
Hello, With my application that uses heavily inherent classes, sometimes I
deeeeep class heirarchies can lead to brainfreeze - beware of going to deep :-)
get the following message: PHP Fatal error: Call to undefined method Rank::_construtor() in
.../inc/Links.class.php.                           It works  with php
4.x when I use the old style of constructor calling $this->(CLASSNAME) . But when working with php 5.2 b2 or b3 in the old OR the new style, I get the PHP Fatal error from above. Is there any hints to look at this problem?
Why do you call _construct instead of __construct? And how do you do it?
he seems to be calling _construtor() which although not wrong is not the method he is looking for (cue voice of Alex Guiness for the second time this week :-) try __construct() PS - this kind of thing belongs on generals until you are _sure_ it's an internals problem. IMHO.
Did you read everything at http://php.net/construct (including Note)? What about php 5.0?


« previous php.general (#219885) next »