#42455 [Opn->Fbk]: "Call to undefined method" - but method isn't undefined!

From: Date: Tue, 28 Aug 2007 13:32:28 +0000
Subject: #42455 [Opn->Fbk]: "Call to undefined method" - but method isn't undefined!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116769@lists.php.net to get a copy of this message
ID: 42455 Updated by: jani@php.net Reported By: klikics at preisroboter dot de -Status: Open +Status: Feedback Bug Type: Class/Object related Operating System: Linux PHP Version: 5.2.3 New Comment: That is not the script I'm looking for.. Please read the instructions how to report. Leave this as 'Feedback' until you actually have something useful to give as feedback.. Previous Comments: ------------------------------------------------------------------------ [2007-08-28 13:04:48] klikics at preisroboter dot de Thanks for your fast answers! I've disabled Suhosin and eAccelerator already 2 days ago, but it still appears. Sorry, but I can't reproduce it because I only got the error twice and some visitors of our site reported it. Code example: search.php ########## require("class.php"); $search = new search(); // ... class.php: ########## class search{ function search() { $foo = new cluster_search(); // ... } // ... } class cluster_search { function cluster_search() { // ... $bar = $this->get_threader(); // here appears the error sometimes } function get_threader() { $bla = fsockopen(); // ... return $bla; } // ... } ------------------------------------------------------------------------ [2007-08-28 12:29:54] jani@php.net As long as you can't reproduce it reliably and not able to give us any code to test ourselves this report is kinda useless. First thing you should try is to remove all 3rd party extensions (f.e. any Zend extensions like optimizers, encoders and caches). Then you install the latest CVS snapshot found here: http://snaps.php.net/php5.2-latest.tar.gz And if that doesn't work, you tell us what configure line you used to configure PHP and how we can reprodcue it.. ------------------------------------------------------------------------ [2007-08-28 12:24:48] klikics at preisroboter dot de Ok, another try ;-) I've got a class "search" and another class "cluster_search" (in the same file). In "cluster" there is a method "get_threader()", but not in "search". In the constructor of "search" is an object $clustersearch created from "cluster_search" and the constructor of "cluster_search" calls the method $this->get_threader() from class "cluster_search". Sometimes, PHP try's to call search::get_threader() instead of $this->get_threader at this moment ($this is here the class "cluster_search") and throws this error: Fatal error: Call to undefined method search::get_threader() in /www/class_.php on line 1305 The problem is, that I can't reproduce this error. I hope it's not to much confusion ... ;) ------------------------------------------------------------------------ [2007-08-28 11:15:49] jani@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2007-08-28 09:44:56] klikics at preisroboter dot de Description: ------------ Sometimes PHP throw's the following error: Fatal error: Call to undefined method suche::get_threader() in /www/class_.php on line 1305 instead of just processing the function $this->get_threader() ... This comes up only every 10000 requests or something, so I can't reproduce it. I'm wondering about the "::", because the call in the script is $this->get_threader(). That's why I think it's an internal bug of PHP. The .php with the class is included via require() to the page where the error appears. Hope this helps or you can help. Thanks in advance. Reproduce code: --------------- // line 1305 $fp = $this->get_threader(); Expected result: ---------------- $fp is a filepointer from fsockopen() .. the script should progress. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42455&edit=1

« previous php.bugs (#116769) next »