ID: 30791
Updated by: [email protected]
Reported By: alan at akbkhome dot com
-Status: Feedback
+Status: No Feedback
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2004-11-15 (dev)
New Comment:
No feedback was provided for this bug for over a week, 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".
Previous Comments:
------------------------------------------------------------------------
[2005-03-07 21:55:43] [EMAIL PROTECTED]
This is what I get with latest CVS HEAD:
# php5 t.php
Notice: serialize(): __sleep should return an array only containing the
names of instance-variables to serialize. in /home/jani/t.php on line
10
------------------------------------------------------------------------
[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