#24670 [Com]: defining __call requires __sleep for serialize/session

From: Date: Mon, 17 May 2004 21:28:59 +0000
Subject: #24670 [Com]: defining __call requires __sleep for serialize/session
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969360668@lists.php.net to get a copy of this message
ID: 24670 Comment by: magicking89 at hotmail dot com Reported By: tater at potatoe dot com Status: Open Bug Type: Documentation problem Operating System: OS X 10.2 PHP Version: Irrelevant New Comment: I have the same problem with PHP5 RC2 on Mac Os X 10.2 It's a real problem because I must to close socket with __sleep but it doesn't work correctly... Previous Comments: ------------------------------------------------------------------------ [2003-07-16 01:07:06] tater at potatoe dot com Description: ------------ If you create a __call() method for a class, and then try to serialize it yourself, or store an object of that class in $_SESSION, you need to either explicitly define a __sleep() method as well, or make sure that __call() will respond appropriately. Otherwise serialize() will complain. It seems unlikely that this is a bug, though I suppose it might be a feature request. So it should just be spelled out in the documentation for __call() when that gets written. Reproduce code: --------------- class foo { function __call() { return; } } $a = new foo; serialize($a); Expected result: ---------------- n/a Actual result: -------------- n/a ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24670&edit=1

« previous php.doc (#969360668) next »