note 60783 added to function.serialize
| From: | php-general at lists dot php dot net | Date: | Mon, 16 Jan 2006 15:47:47 +0000 |
| Subject: | note 60783 added to function.serialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101928@lists.php.net to get a copy of this message | ||
I use PHP 4.3.10 and I found out that if you use a class "MyClass", the constructor of the
class must be called "__construct()" and NOT "MyClass()" like in Java or other
languages.
If you use the "MyClass()" constructor, the following won't work :
$_SESSION['obj_my_class'] = new MyClass();
If you don't believe me, you can have a look in the directory "session.save_path"
(default /var/lib/php4) where is stored the session's file. You will see this :
obj_my_class|N;
and not your complete class!
It took me almost one day to understand what was happening... :-(
----
Submitter IP: 217.174.203.10
----
Manual Page -- http://www.php.net/manual/en/function.serialize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60783
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60783&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60783&report=yes
Search -- http://master.php.net/manage/user-notes.php