PHP 4.0 Bug #3179: Classnames of objects in session
| From: | peter at desk dot nl | Date: | Tue, 11 Jan 2000 14:08:25 +0000 |
| Subject: | PHP 4.0 Bug #3179: Classnames of objects in session | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14501@lists.php.net to get a copy of this message | ||
From: peter@desk.nl
Operating system: RedHat Linux 6.1
PHP version: 4.0 Beta 3
PHP Bug Type: Feedback Needed
Bug description: Classnames of objects in session
I have three .php-files, called in this order :
1) start session, set some general session-variables
2) generate object, store in session
3) call member-function, show results
Scripts 2 and 3 use a 'require' statement to include the class-definition, script 1
doesn't. The above order of calling scripts work fine. Session-file shows this :
tst|O:3:"app":6:{s:5:"start";s:9:"952606800";s:3:"end";i:952608600;s:4:"desc";s:2:"aa";s:8:"id_users";a:0:{}s:6:"errors";a:0:{}s:4:"time";i:0;}
Seems fine to me. Now, when I return and follow the three
steps _again_, I get an error that the member-function does not exist anymore. The session file now
shows :
tst|O:7:"stdClass":6:{s:5:"start";s:9:"952606800";s:3:"end";i:952608600;s:4:"desc";s:2:"aa";s:8:"id_users";a:0:{}s:6:"errors";a:0:{}s:4:"time";i:0;}
Behold ! The classname has been changed ! No wonder I can't access its member-function.
I traced the problem to the fact that in step 1) the class definition is _not_ included (when I do,
the problem disappears). However, the object in question is not used or referenced in step 1) (the
session is, of course).
Is this a bug or a feature ? Do I have to include the class-definition every time I use the session
?