|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-08 11:48 UTC] paydorrr at gmail dot com
-Status: Open
+Status: Closed
[2010-07-08 11:48 UTC] paydorrr at gmail dot com
[2013-01-03 13:58 UTC] live dot to dot ride at seznam dot cz
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 17:00:01 2025 UTC |
Description: ------------ I just hit an unexpected problem: serialize() counts new lines as characters, although in the serialized output, those characters do not appear. The character count of the serialized string is then wrong and unserialize() ist not possible. Test script: --------------- $textOne = "String to serialize with multiple lines!"; $array = Array(0 => $textOne); echo serialize($array); /* This will print out: a:1:{i:0;s:42:"String to serialize with multiple lines!";} The problem with that is, that the serialized String is actually 40, not 42 characters long. Because of that, you cannot unserialize the whole serialized Array. */ Expected result: ---------------- a:1:{i:0;s:40:"String to serialize with multiple lines!";} Actual result: -------------- a:1:{i:0;s:42:"String to serialize with multiple lines!";}