php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44004 Information on how Objects with non-public properties are serialized is missing
Submitted: 2008-01-31 18:47 UTC Modified: 2008-11-07 13:21 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mfischer@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mfischer@php.net
New email:
PHP Version: OS:

 

 [2008-01-31 18:47 UTC] mfischer@php.net
Description:
------------
The documentation lacks the information that objects with non-public properties uses a special syntax to associate that information with a property.

For protected properties, the property name is prefixed with \000, an asterisk, and \000 again.

For private properties, the property name is prefix with \000, the follows the class the property is defined in, then \000 again.

It's an important factor to keep in mind when transporting the serialized format, null-bytes or probably not easily expected in such a case.

The documentation should probably be reflected on php.net/manual/en/language.oop.serialization.php. I think it wouldn't heard if the link to object serialization one php.net/serialize could be made a bit more prominent.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-31 18:48 UTC] mfischer@php.net
In the first paragraph, I more precisely meant: "... uses a special serialization syntax ..."
 [2008-11-07 13:21 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

The same rules as in converting to array applies:

"Object's private members have the class name prepended to the member name; protected members have a '*' prepended to the member name. These prepended values have null bytes on either side."
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 12:00:01 2026 UTC