PHP 5 Classes and Objects
Posted: Fri Oct 28, 2005 6:23 am
Hello,
I got question about classes in PHP5,
For example I have developed 2 classes MyClass1 and MyClass2
in files MyClass1.php and MyClass2.php
Then I want to use them in file index.php, next.php and close.php
Suppose that users are connecting on page index.php,
And I create new MyClass1Obj and MyClass2Obj in index when the connexion is set
what is the life time of Objects MyClass1Obj and MyClass2Obj ?
During all the session of one user ?
Is it shared between differents users ?
Can I destroy the object myself using MyClass1Obj.__destruct() ?
I would like to create some objects that are available :
for only one user and during all the session.
for everybody, reusable between user and session.
How can I do that ?
Thanx
I got question about classes in PHP5,
For example I have developed 2 classes MyClass1 and MyClass2
in files MyClass1.php and MyClass2.php
Then I want to use them in file index.php, next.php and close.php
Suppose that users are connecting on page index.php,
And I create new MyClass1Obj and MyClass2Obj in index when the connexion is set
what is the life time of Objects MyClass1Obj and MyClass2Obj ?
During all the session of one user ?
Is it shared between differents users ?
Can I destroy the object myself using MyClass1Obj.__destruct() ?
I would like to create some objects that are available :
for only one user and during all the session.
for everybody, reusable between user and session.
How can I do that ?
Thanx