Additional note about what Maurice said: you can also use an __autoload function which will get called as the session/var is unserialized.
This will allow you to not preload all possible classes before loading a session, and let them be loaded dynamically. Check http://php.net/oop5.autoload for more details about this magic function.
main
(No version information available, might be only in CVS)
main — Página predeterminada para main()
Descripción
No existe una función llamada main(), excepto en el código fuente de PHP. En PHP 4.3.0, un nuevo tipo de gestión de errores en las fuentes de PHP (php_error_docref) fue añadido. Una característica es la de proveer enlaces a la página del manual en los mensajes de error de PHP cuando las directivas PHP html_errors (habilitada por defecto) y docref_root (habilitada por defecto hasta PHP 4.3.2) están definidas.
Algunas veces los mensajes de error se refieren a una página del manual para la función main(), razón por la que existe esta página. Por favor agregue un comentario de usuario a continuación que mencione qué función de PHP causó el error que enlazaba con main() y ésta será arreglada y documentada apropiadamente.
| Nombre de función | Ya no apunta hacia aquí a partir de |
|---|---|
| include() | 5.1.0 |
| include_once() | 5.1.0 |
| require() | 5.1.0 |
| require_once() | 5.1.0 |
main
28-Nov-2007 08:31
01-May-2006 09:12
Notice: main() [function.main]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "<classname>" 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 <filename> on line <line>
You get this error if you have and object in your $_SESSION array and you call session_start() before you have loaded your included classes.
