Your assumption is incorrect. We are comparing ‘checkthedatabaseplease’ against the value retrieved by memcached. And ‘checkthedatabaseplease’ does not evaluate to 0.
The actual code snippets are:
WP_Object_Cache::get
if ( 'checkthedatabaseplease' === $value ) {
unset( $this->cache[$key] );
$value = false;
}
WP_Object_Cache::set
if ( isset($this->cache[$key]) && ('checkthedatabaseplease' === $this->cache[$key]) )
return false;
So in your case for WP_Object_Cache::get, it would be performing the following evaluation:
if ( 'checkthedatabaseplease' === 0 ) {
which would return false, not true, since they are obviously not the same values.
This allows us to store a value of ‘checkthedatabaseplease’ in memcached, to get the calling function to believe no data was returned and to look at the database for the correct data.
Forgive me for my ignorance, but I really don’t see how I am incorrect here.
>> if ( ‘checkthedatabaseplease’ === 0 ) { which would return false, not true, since they are obviously not the same values.
That’s not what it does, it does if ( 'checkthedatabaseplease' == 0 )
which is (bool) true
Ah, I see where you and I are on different pages. Apparently that change was fixed 13 months ago in the development version ( http://plugins.trac.wordpress.org/changeset?reponame=&new=427207%40memcached%2Ftrunk%2Fobject-cache.php&old=425137%40memcached%2Ftrunk%2Fobject-cache.php ), however we haven’t pushed a new release in 15 months.
I will push a new release soon.
Ok, I have tagged a new release. 2.0.2 is showing up in the repo now.