Re: parent::construct not reliable working on php5.1 b2/b3
| From: | Jochem Maas | Date: | Wed, 03 Aug 2005 08:22:27 +0000 |
| Subject: | Re: parent::construct not reliable working on php5.1 b2/b3 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219884@lists.php.net to get a copy of this message | ||
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-6any 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
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 -
d) never tested i jump over 5.05.1 is still beta - test it on 5.0 (consider that the mailing list equivelant of a military order ;-) does the problem occur in only 1 baseclass? or in a fixed number of baseclasses? or is does it occur anywhere/everywhere. 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) pump up error_reporting to full i.e. error_reporting( E_ALL | E_STRICT ) - maybe it will give you a hint. also you might consider placing a call to debug_print_backtrace() in each and every constructor to help see wtf is going on. 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.
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 sillyI know that ;-) I was just trying to make sure you didn't feel as if I was talking down to you :-)
meno Am 02.08.2005 um 23:34 schrieb Jochem Maas:Meno Abels wrote:it is only a typo in my email i use __constructok - 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:deeeeep class heirarchies can lead to brainfreeze - beware of going to deep :-)Hello, With my application that uses heavily inherent classes, sometimes Ihe 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.get the following message: PHP Fatal error: Call to undefined method Rank::_construtor() inWhy do you call _construct instead of __construct? And how do you do it?.../inc/Links.class.php. It works with php4.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?Did you read everything at http://php.net/construct (including Note)? What about php 5.0?