[nycphp-talk] Incomplete Objects, Class Definitions and require_once

Michael B Allen ioplex at
Sun Aug 5 14:49:08 EDT 2007


Every once in a while I run into this and it takes a few hours to
figure out what the right sequence of require_once statements are
required to wriggle out of it:

Notice: [...] The script tried to execute a method or access a
property of an incomplete object. Please ensure that the class
definition "Foo" of the object you are trying to operate on was loaded
_before_ unserialize() gets called or provide a __autoload() function
to load the class definition in [...]

Can someone explain to me what I need to know about how class
definitions are loaded so that I can make some sense of these errors?

It's not simply a matter of including the necessary file in the right
spot. Clearly there are other forces at work and I'd like to know what
they are.


More information about the talk mailing list