Title: Value-by-reference bug (with fix!)
Last modified: August 21, 2016

---

# Value-by-reference bug (with fix!)

 *  [Jeff Stieler](https://wordpress.org/support/users/jeffstieler/)
 * (@jeffstieler)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/value-by-reference-bug-with-fix/)
 * Here is a patch for a bug with the Memcached plugin.
 * [https://gist.github.com/jeffstieler/6641955](https://gist.github.com/jeffstieler/6641955)
 * If you retrieve an object value from Memcached and then modify that object, you
   actually modify the in-memory copy stored in $this->cache[$key].
 * This patch clones the object later in the get() method, avoiding the problem.
 * [http://wordpress.org/plugins/memcached/](http://wordpress.org/plugins/memcached/)

The topic ‘Value-by-reference bug (with fix!)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/memcached.svg)
 * [Memcached Object Cache](https://wordpress.org/plugins/memcached/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/memcached/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/memcached/)
 * [Active Topics](https://wordpress.org/support/plugin/memcached/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/memcached/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/memcached/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Jeff Stieler](https://wordpress.org/support/users/jeffstieler/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/value-by-reference-bug-with-fix/)
 * Status: not resolved