ID:               27782
 User updated by:  giovanni at giacobbi dot net
 Reported By:      giovanni at giacobbi dot net
 Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      4.3.4
 New Comment:

the following revision:

+++ ext/standard/array.c        30 Mar 2004 19:09:10 -0000     
1.199.2.31



has been tested and perfectly works.

Thank you.


Previous Comments:
------------------------------------------------------------------------

[2004-03-30 14:00:23] [EMAIL PROTECTED]

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.



------------------------------------------------------------------------

[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

Reply via email to