ID: 44792 Updated by: [EMAIL PROTECTED] Reported By: alex at fav dot or dot it -Status: Assigned +Status: Bogus Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.2.5 Assigned To: helly New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php That's just how PHP works. If you don't like the 0's then use interface Serializable: $> php --rc Serializable Previous Comments: ------------------------------------------------------------------------ [2008-07-21 14:33:13] penny at mjollnir dot org Present in 5.2.6 as well. ------------------------------------------------------------------------ [2008-07-15 17:22:32] [EMAIL PROTECTED] Marcus, yet another PPP issue. ------------------------------------------------------------------------ [2008-04-21 11:14:12] alex at fav dot or dot it Description: ------------ The output from the serialization of objects that contain protected (and possibly private also) members contains null characters. These characters are unnecessary and can cause problems when inserting the serialized data into databases. An asterisk is placed before the variable name in the serialized string, which I assume is to mark it as protected. This asterisk is surrounded by null characters. This appears to be the same as the closed #29865 (closed 10/2005), but in version 5.2.5 and the latest snapshot, the bug still exists. Reproduce code: --------------- php -r 'class Foo { protected $bar = 1; } $v = new Foo; echo serialize($v);' | hexdump Expected result: ---------------- The output should not contain null characters (shown as '00') around the asterisk. Actual result: -------------- 0000000 3a4f 3a33 4622 6f6f 3a22 3a31 737b 363a 0000010 223a 2a00 6200 7261 3b22 3a69 3b31 007d 000001f ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44792&edit=1