As the documentation notes, this function returns false if it doesn't replace an existing item (You must have added the item before for replace to work). If you're writing a dynamic application which for example caches data from an SQL database, your code should look like this.
<?php
if(!$mc->replace('foo', 'bar'))
{
$mc->add('foo', 'bar');
}
?>
This ensures that the memcache server is repopulated properly everytime it is restarted.