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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 05:01:23 2020 UTC