Re: PHP 5.2: Serialization patch
| From: | Stefan Esser | Date: | Thu, 07 Dec 2006 11:35:28 +0000 |
| Subject: | Re: PHP 5.2: Serialization patch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26830@lists.php.net to get a copy of this message | ||
Guys,
why can't you simply introduce a new variable type for serialized
strings like uppercase S:
There is absolutely no need for breaking backward compatibility. If you
want to introduce
NEW features then introduce them and do not abuse old ones.
Stefan
Andrei Zmievski schrieb:
> I don't see a way we can make it work for all the cases. I guess we'll
> have to leave this task to PHP_Compat.
>
> -Andrei
>
> On Dec 1, 2006, at 3:03 PM, Ilia Alshanetsky wrote:
>
>> As it stands the current code breaks BC on decoding when the
>> serialized string contains \ characters.
>>
>> For example:
>>
>> Input PHP 5.2 PHP 5.2 w/patch
>> -------------------------------------------------------------------------------------------
>>
>> s:7:"foo\10b"; foo\10b error (NULL
>> returned)
>> s:7:"foo\bar"; foo\bar error (NULL
>> returned)
>> s:5:"\\\\\"; \\\\\ error (NULL
>> returned)
>>
>> Basically any operation involving strings with \ in them, stop
>> working once the patch is applied.
>>
>> There is also the performance drawback to consider, which based on a
>> rudimentary test involving $_SERVER serialization, shows that the new
>> code is roughly 1/2 slower.
>>
>> 5.2: 0.388
>> 5.2 w/patch: 0.652
>>
>> Ilia
>
> --PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>