|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-30 14:00 UTC] iliaa@php.net
[2004-03-30 15:11 UTC] giovanni at giacobbi dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
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)