php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44806 Serialize an Object with Private vars in txt file
Submitted: 2008-04-23 08:48 UTC Modified: 2008-04-23 08:56 UTC
From: aymeric dot jouno at free dot fr Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.5 OS: XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aymeric dot jouno at free dot fr
New email:
PHP Version: OS:

 

 [2008-04-23 08:48 UTC] aymeric dot jouno at free dot fr
Description:
------------
There is a mismatch/bug under PHP 5.2.5( id don't try it in other version)

CONTEXT :

Serialize an Object with Private vars in a text file using 
fopen no binary and fwrite.



RESULT :

serialize Object is forced to bad binary mode in file.
if you change private vars to public vars it work !...


SOLUTION :
1 but poor => encode_base_64(Serialized Objet)
2 good => use fopen in binary mode


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-23 08:56 UTC] derick@php.net
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

This is correct, private (and also protected) methods are serialized containing a \\0 character.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC