From 4cc9b183d797cbd3d1f6230a46cb5df6e6161dbb Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 12 Jan 2010 12:20:45 -0800 Subject: 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. --- classes/Memcached_DataObject.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'classes/Memcached_DataObject.php') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index b68a4af8e..9c9994cea 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; } } } -- cgit v1.2.3-54-g00ecf