Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
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 wrote: > Hi! > > >> I can try to make a patch to solve it, but before that I would like how > >> the behavior should be. Some

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Stanislav Malyshev
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 t

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
Thanks for changing the top posting. :) About the solution, I like the way HHVM solves that. It is also more consistent with the case where you add the invalid value as string on the __sleep (ie, on http://3v4l.org/kupOg I changed the 1 from integer to string). If you return "N;" is hard to detect

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Rowan Collins
On Thu, Feb 5, 2015 at 9:57 AM, Rowan Collins > wrote: Playing around with existing behaviour, if you return something other than an array, you get a Notice and a serialized null ('N;') - e.g. http://3v4l.org/rm9rs I think it would be reasonable

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
Rowan, It is happening and giving the same message, but the problem is the generate value is corrupted because it generates N; without the key. Ie, when you have a valid field and an invalid field it generates O:1:"C":2:{s:1:"a";b:1;N;} (note that "a" is the property name, 1 is the boolean value a

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Rowan Collins
Juan Basso wrote on 05/02/2015 14:07: No one? On Mon, Feb 2, 2015 at 8:57 PM, Juan Basso wrote: Hi, I was testing few things today and I released one bug in the serialize function. The serialize function returns a corrupted value when it is serializing an object that contains a __sleep magic

[PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
No one? On Mon, Feb 2, 2015 at 8:57 PM, Juan Basso wrote: > Hi, > > I was testing few things today and I released one bug in the serialize > function. The serialize function returns a corrupted value when it is > serializing an object that contains a __sleep magic method and this method > return