%s::__sleep() should return an array only containing the names of instance-variables to serialize¶
Description¶
The return type of __sleep is actually array, even when it is not mentioned. Any other returned value generate this error.
Example¶
<?php
class X {
function __sleep() {
return 1;
}
}
serialize(new X);
?>
Solutions¶
Return an array from
__sleep.Add the return type
arrayand return an array from__sleep.Remove the
__sleep()method.