php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26637 pickle/unpickle function
Submitted: 2003-12-16 01:20 UTC Modified: 2003-12-16 01:26 UTC
From: scott at scottdial dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: Any OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 43 = ?
Subscribe to this entry?

 
 [2003-12-16 01:20 UTC] scott at scottdial dot com
Description:
------------
For the unknowing, pickle is the python derived term for object serialization. Currenlty, session management has such functionality, but this functionality is not exposed to the programmer to be done outside of using a session. I propose there be a pickle/unpickle function that uses the same serialization method that the session managment uses.

Reproduce code:
---------------
$foo = array(1, 2, 3)
$string = pickle($foo);

echo $string;

$bar = unpickle($foo);

echo $bar;
print_r($bar);

Expected result:
----------------
a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}

Array
Array ( [0] => 1 [1] => 2 [2] => 3 )



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-16 01:23 UTC] scott at scottdial dot com
I typo'd.. should be: $bar = unpickle($string);
 [2003-12-16 01:26 UTC] scott at scottdial dot com
Doh, I needed to RTFM harder :-p
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC