note 83767 deleted from function.memcache-set by danbrown

From: Date: Sat, 19 Jun 2010 03:57:55 +0000
Subject: note 83767 deleted from function.memcache-set by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170274@lists.php.net to get a copy of this message
Note Submitter: eseaberg at adbrite dot com ---- "Other types are stored serialized" isn't true, at least as of PHP 5.2.0 with memcache extension $Revision: 1.85 $. Null is serialized, but for an int, float, or bool, Memcache::set converts the value to a string (actually it tampers with the caller's zval, as if taking it by reference and using settype) and Memcache::get will return a string instead of the original type. Using $memcache->set($key, serialize($var), 1) is a workaround. This undocumented bit in $flag tells Memcache::get to deserialize the value it reads. If this bit is set on a value that can't be deserialized, the server is marked as failed.

« previous php.notes (#170274) next »