Hi,
I've a problem with the objetcs and the session.
I've the following code to initialize my array $GLOB
<?
include_once("class_a.php"); // définition de classe_a
include_once("class_b.php"); // définition de classe_b
session_register("GLOB");
$GLOB = array();
$GLOB["my_object"]= new a();
?>
in another file
<?
include_once("class_a.php");
include_once("class_b.php");
session_start();
$GLOB["my_object"]->print();
?>
I don't always knows what the object stred in $GLOB["my_object"] is.
To avoid the following error message, I must include all the class definitions
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition classe_a of the object you are trying to operate on was loaded before the session was started
Is there a way to avoid including all the class definitions before the session_start() ?
Thank you
Laurent