|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14950 crash with __sleep() and __wakeup()
Submitted: 2002-01-09 10:36 UTC Modified: 2002-10-14 19:26 UTC
Avg. Score:4.7 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.2.0-dev OS: Debian SID
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2002-01-09 10:36 UTC]
Passing objects using the magic __sleep() and __wakeup() methods through sessions fail.

In the best case the script fails without error. In the worst, an integer in session turns into the value of the PHP session ID and the object is not registered.

Yasuo Ohgaki guesses it's a serialize/unserialize problem.

Make log :

/usr/src/web/php/php4/ext/standard/ In function `php_var_unserialize':
/usr/src/web/php/php4/ext/standard/ warning: comparison is always false due to limited range of data type

Tests :
PHPInfo() :


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-09 10:38 UTC]
Forgot to tell : asking for .phps will show you the source in the /test/session/ directory.
 [2002-02-03 19:44 UTC]
This will be next my target to fix :)
 [2002-03-06 03:25 UTC]
Version update

I just take a look at what is going on, __sleep and __wakeup is messed badly. It does not work at all and even crashes...

 [2002-03-22 05:30 UTC]
Could you try CVS version to see if this bug is fixed?
 [2002-04-03 11:06 UTC]
I just tested. It does not work.
 [2002-04-13 12:48 UTC] artus at nickpicker dot de
I have the same problem running apache 2.0.35 and php 4.2 RC3 under Win2K ...
 [2002-05-28 14:58 UTC] ben at luistert dot nl
I use php 4.2.1 as apache module on a win95 system and it crashes whenever I try to serialize an object (in a session or otherwise) that has a __sleep() function.
 [2002-09-16 08:09 UTC] bs_php at sourceforge dot com
Bug remains (Apache crash)
SERVER_SOFTWARE: Apache/1.3.26 (Win32) PHP/4.2.3 
OS: Win2000
Apache: 1.3.26

Sample Code:
class A {
  function A() {}
  function __sleep() {return;}
$a = new A();
$stream = serialize($a);
 [2002-09-26 16:41 UTC]
Please try using this CVS snapshot:
For Windows:

Cannot replicate this using latest CVS on Windows or Linux.
 [2002-10-14 19:26 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 21:01:28 2024 UTC