(PHP 3, PHP 4, PECL)

dbmdelete --  Deletes the value for a key from a DBM database


bool dbmdelete ( resource dbm_identifier, string key )

Deletes the value for key in the database.

Returns FALSE if the key didn't exist in the database.

add a note add a note User Contributed Notes
v dot a dot rao at online dot nl
10-Sep-2000 04:53
Doesn't return false if the key is not in the database (contrary to what the documentation states).

Returns -1 (TRUE) if the key doesn't exist
Returns 0 (FALSE) if the key does exist

This is still a bug (3.0.16 and 4.0.2) and it can still cost you your Saturday afternoon if you comply with the PHP documentation on TRUE (non-zero) and FALSE (0) with regards to this function.