PHP SDK Delete


#1

Can you please confirm this?
I am trying to remove a document via http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-update-delete.html#table-couchbase-sdk_php_delete.
the code snippet :
var_dump($CB->delete(“DOCUMENT_UUID”));
The output coming as
string(1) "0"
But data is getting removed.
And when the DOCUMENT_UUID is not present, its returning
bool(false)
In PHP most of the cases 0 represents False. :frowning:
Like

if(0)
{
// This not happen.
}
if(false)
{
// This not happen as above.
}

Is that it supposed to do?
Can somebody confirm this?


#2

I recommend you to use the === comparator always in PHP to remedy exactly this kind of situation. If you then compare it with === false, it should work as expected!