I was seeing some warnings about recent clone changes:
Warning: __clone method called on non-object in /var/www/moodle/lib/dmllib.php on line 2586
And realised it was to do with empty stuff being sent to rcache_set().
I thought I was going crazy because:
$foo = get_record('course', 'id', '99999999999');
trigered the warning but this didn't:
$foo = get_record('course', 'shortname', '99999999999');
Then I realised $docache is only set when id is the first record.