By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

Call to a member function on a non-object?

P: n/a
Hi,

I am 'hacking' a bit on the opensource blog system Geeklog and while using
a function of the code in another context, I get this error:

Fatal error: Call to a member function on a non-object

I think it would be too much here to go into detail where the error occurs
exactly. Its while calling a custom error-handling function.

what I would like to know is what this error-message means and what I can
conclude from it so I can derive the problem

thanks!

Oliver

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Oliver Spiesshofer wrote:

I am 'hacking' a bit on the opensource blog system Geeklog and while
using a function of the code in another context, I get this error:

Fatal error: Call to a member function on a non-object

I think it would be too much here to go into detail where the error occurs
exactly. Its while calling a custom error-handling function.

what I would like to know is what this error-message means and what I can
conclude from it so I can derive the problem


Like it says - your code has tried to treat something which is not an object
as if it were (typically by calling $not_an_object->method())

Either the object has not been instantiated or it was copied from something
else which was not an object.

This can also happen if serialize & store an object / change the class
definition and re-instate the object.

HTH

C.
Jul 17 '05 #2

P: n/a
Like it says - your code has tried to treat something which is not an object as if it were (typically by calling $not_an_object->method())

Either the object has not been instantiated or it was copied from something else which was not an object.

This can also happen if serialize & store an object / change the class
definition and re-instate the object.


One possibility is some function that returns either object or false, like
myqsl_fetch_object. Then if you don't check which one you got anf try to
use methods..
Jul 17 '05 #3

P: n/a
Colin McKinnon <co**************@andthis.mms3.com> wrote in
news:cd*******************@news.demon.co.uk:
Like it says - your code has tried to treat something which is not an
object as if it were (typically by calling $not_an_object->method())


thanks, that was the problem

Oliver

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.