Object lifetime
| From: | roger helgesen | Date: | Tue, 21 Feb 2006 15:12:53 +0000 |
| Subject: | Object lifetime | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-230810@lists.php.net to get a copy of this message | ||
I'v got CLASS 1 and CLASS2.
CLASS1 makes many instanses of CLASS2 and stores them in an array.
Ex.
----------------------------------
load class definition...
start_session();
<html>
<form typ......
<?PHP
$cl1=new CLASS1;
----------------
I serialize CLASS1 into a $_SESSION['cla1']
->submit form ->
and unsreialize it to same var
$cl1=unserialize($_SESSION['cla1']);
$cl1 is operational with same data as before 'submit form'. I can change values of data in $cl1.
I CAN read/print data in the instanses of CLASS2 that $cl1 created before 'submit form'.
I CAN NOT change the data in the instanses of CLASS2 that $cl1 created before 'submit form'.
mark I'v only serialized CLASS1.
Is this at all possible ??
I'v find it strange since I can use/print the data that is stored in CLASS2 before 'submit form'.
regards
Roger Helgesen