|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-27 23:06 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 08:00:01 2025 UTC |
Description: ------------ serialized string returned by serialize, contains invalid chars only when serializing an object with protected or private properties. Reproduce code: --------------- <? class Foo { protected $bar = 123; //public $bar = 123; } $f = new Foo(); echo serialize($f); ?> Expected result: ---------------- comment protected and uncomment public and the right result is given: [[O:3:"Foo":1:{s:3:"bar";i:123;}]] Actual result: -------------- [[O:3:"Foo":1:{s:6:" wich means: [[O:3:"Foo":1:{s:6:"NULL*NULLbar";i:123;}]] where NULL is the char \0