php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58664 Add JSON support for serialization
Submitted: 2009-05-07 19:55 UTC Modified: 2012-03-07 17:16 UTC
From: don at smugmug dot com Assigned: andrei (profile)
Status: Closed Package: memcached (PECL)
PHP Version: Irrelevant OS: CentOS 5
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:
48 - 20 = ?
Subscribe to this entry?

 
 [2009-05-07 19:55 UTC] don at smugmug dot com
Description:
------------
At least with our datatypes, we're seeing compressed JSON 
result in smaller strings than compressed igbinary (and much 
smaller than compressed serialized PHP).  Plus JSON has the 
added benefit of working in essentially every language.

Would you mind adding JSON as a selectable serializer?

Using json_decode(), we ask it to send an associative array 
back rather than an object.  Possibly a config option if you 
don't want to default to that?

Thanks!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-24 06:38 UTC] mjs at beebo dot org
This is somewhat undocumented, but (in 1.0 at least) you can 
use the JSON serializer with:

$memcached->setOption(Memcached::OPT_SERIALIZER, 
Memcached::SERIALIZER_JSON);

However, as you note, $memcache->get(...) does return an 
object rather than an array even if an array was set() in the 
first place.  I've reported this as bug #16755.
 [2012-03-07 17:16 UTC] andrei@php.net
Closing because of age. Please try version 2.0.1 and reopen if this still occurs.
 [2012-03-07 17:16 UTC] andrei@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC