Re: Re: Serialize generating corrupted data
| From: | Stanislav Malyshev | Date: | Thu, 05 Feb 2015 17:30:09 +0000 |
| Subject: | Re: Re: Serialize generating corrupted data | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81948@lists.php.net to get a copy of this message | ||
Hi!
>> I can try to make a patch to solve it, but before that I would like how
>> the behavior should be. Some options:
>> 1) Give the notice saying the field doesn't exist and do not include on
>> the serialized response
>> 2) Give the notice saying the field doesn't exist and convert the value to
>> string (ie, on my example the int(1) would be transformed to string(1))
I'd try (2) if it doesn't work (which probably would be the case unless
your object happens to have property named "42" somehow) then produce a
notice and omit it. If __sleep returns wrong value completely - e.g.
false, I'd produce a warning and serialize it as null.
--
Stas Malyshev
smalyshev@gmail.com