ID: 27782 Updated by: [EMAIL PROTECTED] Reported By: giovanni at giacobbi dot net -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.3.4 New Comment:
This bug has been fixed in CVS. 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/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2004-03-30 12:09:37] giovanni at giacobbi dot net Description: ------------ As stated in documentation, next() returns the NEXT element in the array and THEN increases internal pointer. Thus, when this function returns FALSE, I expect the internal pointer to be in the last position, thus prev() should return end()-1 element. Reproduce code: --------------- <?php $a = array("a", "b", "c"); reset($a); while (next($a) !== FALSE); var_dump(prev($a)); Expected result: ---------------- string(1) "b" Actual result: -------------- bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27782&edit=1