From: Brion Vibber Date: Tue, 12 Jan 2010 20:20:45 +0000 (-0800) Subject: Avoid spewing warnings about returning by reference on memcached cache misses by... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4cc9b183d797cbd3d1f6230a46cb5df6e6161dbb;p=quix0rs-gnu-social.git Avoid spewing warnings about returning by reference on memcached cache misses by setting a var and returning it instead of trying to return false directly. This hacky workaround is brought to you by DB_DataObject's PHP 4 roots. --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index b68a4af8eb..9c9994ceac 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -98,14 +98,16 @@ class Memcached_DataObject extends DB_DataObject } else { $i = DB_DataObject::factory($cls); if (empty($i)) { - return false; + $i = false; + return $i; } $result = $i->get($k, $v); if ($result) { $i->encache(); return $i; } else { - return false; + $i = false; + return $i; } } }