ID: 30791 User updated by: alan at akbkhome dot com -Summary: alan_k Reported By: alan at akbkhome dot com Status: Verified Bug Type: Zend Engine 2 problem Operating System: na PHP Version: 5CVS-2004-11-15 (dev) New Comment:
stupid firefox... Previous Comments: ------------------------------------------------------------------------ [2005-01-13 02:13:41] [EMAIL PROTECTED] Changing to verified - although it's not critical (as overload was experimental in 4.x) it is a BC break - and is a relatively unexpected behaviour.. ------------------------------------------------------------------------ [2005-01-13 02:10:25] alan at akbkhome dot com Marcus already confirmed this needs fixing - the serialize code should not end up calling __call() on overloaded objects. ------------------------------------------------------------------------ [2005-01-13 00:02:03] [EMAIL PROTECTED] >If an object is overloaded (with __call()), then >serializ'ing the object will fail unless __sleep() is defined. .. or unless __call() returns Array of instance names. I'd say there is no bug, 'cos your overloaded __sleep() method indeed returns wrong data. ------------------------------------------------------------------------ [2004-11-15 09:57:51] alan at akbkhome dot com Description: ------------ If an object is overloaded (with __call()), then serializ'ing the object will fail unless __sleep() is defined. It would be far clearer to either a) - force __sleep to defined on overloaded objects (E_WARN?) b) - dont call __call() with the __sleep() request. Reproduce code: --------------- class a { public $a = 4; function __call($a,$b) { return "unknown method"; } } $b = new a; echo serialize($b); Expected result: ---------------- Warning: __sleep is not defined on an overloaded object with __call() Actual result: -------------- Warning about unexpected return value to __sleep() and an empty string output from serialize() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30791&edit=1