From:             tater at potatoe dot com
Operating system: OS X 10.2
PHP version:      5CVS-2003-07-16 (dev)
PHP Bug Type:     Documentation problem
Bug description:  defining __call requires __sleep for serialize/session

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 bug report at http://bugs.php.net/?id=24670&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24670&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24670&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24670&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24670&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24670&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24670&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24670&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24670&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24670&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24670&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24670&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24670&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24670&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24670&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24670&r=gnused


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to