Re: Re: Serialize generating corrupted data

From: Date: Fri, 06 Feb 2015 04:49:00 +0000
Subject: Re: Re: Serialize generating corrupted data
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-82012@lists.php.net to get a copy of this message
Hi, Thanks for the feedback. I opened the pull request (https://github.com/php/php-src/pull/1057). Is that correct? On Thu, Feb 5, 2015 at 12:30 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote: > 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 >

« previous php.internals (#82012) next »