ID: 36696 Updated by: [EMAIL PROTECTED] Reported By: iain at iaindooley dot com Status: Assigned -Bug Type: Class/Object related +Bug Type: Session related -Operating System: FreeBSD 6.0 +Operating System: * PHP Version: 5.1.2 -Assigned To: helly +Assigned To: sascha New Comment:
The solution is easy: close the session before ending your scripts. Otherwise this is a session shutdown issue. Assigning to primary session maintainer. Previous Comments: ------------------------------------------------------------------------ [2006-03-11 04:30:02] iain at iaindooley dot com Description: ------------ if an object that impelements Serializable is stored in the session, and implements __destruct, then __destruct is called before serialize() when the script finishes execution. Reproduce code: --------------- <? class SomeClass implements Serializable { function SomeClass() { } public function unserialize($dat) { echo('called unseriazlize'); } public function serialize() { echo('called serialize<br />'); } function __destruct() { echo('called __destruct<br />'); } } session_name('god'); session_start(); $_SESSION['var'] = new SomeClass(); ?> Expected result: ---------------- called serialize called __destruct Actual result: -------------- called __destruct called serialize ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36696&edit=1