Bug #1230: dbmnextkey misbehaves

From: Date: Fri, 12 Mar 1999 21:51:01 +0000
Subject: Bug #1230: dbmnextkey misbehaves
Groups: php.dev 
Request: Send a blank email to php-dev+get-4593@lists.php.net to get a copy of this message
From: eric@ipass.net Operating system: Solaris 2.5.1 PHP version: 3.0.6 PHP Bug Type: DBM related Bug description: dbmnextkey misbehaves It appears that dbmnextkey returns the next key in a dbm file since the last call to dbmnextkey. Successive calls to dbmnextkey() using the same key value will return different values. Unless i'm not reading the docs right, dbmnextkey() should return the key after the key passed to it. So: echo dbmnextkey($dbm_id, "mykey") . "\n"; echo dbmnextkey($dbm_id, "mykey") . "\n"; echo dbmnextkey($dbm_id, "mykey") . "\n"; ... should always echo the same value. And: <? $dbm_id = dbmopen("anydbm", "w"); $firstkey = dbmfirstkey($dbm_id); $key = $firstkey; while ($key) { echo "$key = " . dbmfetch($dbm_id, $key) . "\n"; $key = dbmnextkey($dbm_id, $firstkey); } ?> ... should be an infinite loop. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4593) next »