#20187 [Csd->Fbk]: serialize and __sleep function
| From: | yohgaki@php.net | Date: | Thu, 31 Oct 2002 15:03:15 +0000 |
| Subject: | #20187 [Csd->Fbk]: serialize and __sleep function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23794@lists.php.net to get a copy of this message | ||
ID: 20187
Updated by: yohgaki@php.net
Reported By: hellayena@yahoo.fr
-Status: Closed
+Status: Feedback
Bug Type: Reproducible crash
Operating System: win2k /iis5
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
It still shouldn't cause Access Violation.
Could you check it with snapshot?
Previous Comments:
------------------------------------------------------------------------
[2002-10-31 07:39:47] hellayena@yahoo.fr
sorry !
it's a misreading of the __sleep function.
to solve the problem , you only just have to return an array
in this function.
However, i don't know why the server sen dme this message
------------------------------------------------------------------------
[2002-10-31 05:05:25] hellayena@yahoo.fr
i'm simply want to serialize a class wich contain
a __sleep function and i've got this message :
PHP has encountered an Access Violation at 019E7712
if i delete the __sleep function this message disappear.
config :
session_auto_start : off;
the following script reproduce the problem :
<?php
require_once('config.inc.php');
class kuru_theme
{
var $Sql;
var $Forum_List;
function kuru_theme() {}
function __sleep() { $this->Sql = 1; }
}
session_save_path($GLOBALS['SessionPath']);
session_start();
list($action, $objet) = each($_GET);
switch($action){
case('start'):
$my_theme = new kuru_theme();
print '<a href="forum.php?list=1">essai</a>';
$_SESSION['forum'] = serialize($my_theme);
break;
case('list'):
$my_theme = unserialize($_SESSION['forum']);
break;
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20187&edit=1