ID:          38240
 Updated by:  [EMAIL PROTECTED]
 Reported By: paul at stunning-stuff dot com
-Status:      Open
+Status:      Feedback
 Bug Type:    Documentation problem
 PHP Version: Irrelevant
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




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

[2006-07-28 01:33:56] paul at stunning-stuff dot com

Description:
------------
The documentation for prev() states the following:

"Returns the array value in the previous place that's pointed to by the
internal array pointer, or FALSE if there are no more elements."

After reading this I was expecting prev() to only change the array
pointer's position if there is a previous element and return false
(without changing the pointer's position) if there isn't a previous
element.

This misconception caused a bug in my code and it took me quite some
time to figure out the problem.

I would suggest you change the text to make it less ambiguous.

The next() documentation is a little more clear, but could also use
some disambiguation.

Bug report #37598 shows that I am not the only one who misunderstood
the docs. The final paragraph in the final post in that bug report is a
good explanation of how prev() and next() work:

"You should check the return value of prev and next. The state is
undefined as out of range. Reset the array after having reached the
end
or beginning."

Thanks for your time and effort,

Paul van der Maas



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


-- 
Edit this bug report at http://bugs.php.net/?id=38240&edit=1

Reply via email to