Edit report at https://bugs.php.net/bug.php?id=62489&edit=1
ID: 62489 Updated by: lstro...@php.net Reported by: marc-bennewitz at arcor dot de Summary: dba_insert not working as expected -Status: Open +Status: Closed Type: Bug Package: DBM/DBA related Operating System: openSUSE 11.3 (x86_64) PHP Version: 5.4.4 -Assigned To: +Assigned To: lstrojny Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Fixed in the 5.5 and master trees. Previous Comments: ------------------------------------------------------------------------ [2012-07-06 08:40:29] marc-bennewitz at arcor dot de Description: ------------ The function "dba_insert" doesn't work as expected with most handlers. On calling "dba_insert" on an already existing key the function should return false and do not trigger a warning but that's not the case on most tested handlers. Test script: --------------- $dba = dba_open(sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('dba_'), 'c', 'qdbm'); var_dump(dba_insert('key', 'test1', $dba)); var_dump(dba_insert('key', 'test2', $dba)); var_dump(dba_fetch('key', $dba)); Expected result: ---------------- bool(true) bool(false) string(5) "test1" Actual result: -------------- RETURN1 RETURN2 WRANING flatfile true false YES inifile true true NO gdbm true false YES qdbm true false YES db4 true false NO -> Didn't test not listed handlers ! ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62489&edit=1