#43852 [Opn]: serialize() uses \0 in its output
| From: | lapo at lapo dot it | Date: | Tue, 15 Jan 2008 11:09:14 +0000 |
| Subject: | #43852 [Opn]: serialize() uses \0 in its output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121296@lists.php.net to get a copy of this message | ||
ID: 43852
User updated by: lapo at lapo dot it
Reported By: lapo at lapo dot it
Status: Open
Bug Type: Strings related
Operating System: *
PHP Version: 5.2.5
New Comment:
On the other hand, (since 5.0.0) there is a testcase that specifically
checks that the output *does indeed* use zero bytes in private&protected
methods (tests/classes/bug26737.phpt).
If that testcase always succeded, I wonder how version 5.0.5 could
possibly have solved the problem outlined in bug #29865 (that is, the
fact that "\0" is used by serialize, the same as this bug does).
Previous Comments:
------------------------------------------------------------------------
[2008-01-15 08:52:46] lapo at lapo dot it
Description:
------------
It seems that bug #29865 is back: in release 5.2.5 serialize() uses
"ASCII 0" to serialize private property names.
Reproduce code:
---------------
% php -r 'class A { private $t;} echo serialize(new A());'|hexdump -C
Expected result:
----------------
00000000 4f 3a 31 3a 22 41 22 3a 31 3a 7b 73 3a 34 3a 22
|O:1:"A":1:{s:4:"|
00000010 ** 41 ** 74 22 3b 4e 3b 7d |.A.t";N;}|
Actual result:
--------------
00000000 4f 3a 31 3a 22 41 22 3a 31 3a 7b 73 3a 34 3a 22
|O:1:"A":1:{s:4:"|
00000010 00 41 00 74 22 3b 4e 3b 7d |.A.t";N;}|
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43852&edit=1