For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2006 > #37572 [Asn->Csd]: The Warning boxes for current(), prev() and next() are not prec









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #37572 [Asn->Csd]: The Warning boxes for current(), prev() and next() are not prec
colder@php.net

2006-05-29, 6:59 pm

ID: 37572
Updated by: colder@php.net
Reported By: phpbug-david at tulloh dot id dot au
-Status: Assigned
+Status: Closed
Bug Type: Documentation problem
PHP Version: Irrelevant
Assigned To: colder
New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

Thanks for spotting this David.


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

[2006-05-28 20:20:45] gavinfo@php.net

Sorry colder, I didn't realise you were already working on
this, go ahead.

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

[2006-05-27 16:59:34] colder@php.net

The note is not completely wrong. If the array contains an element that
is === false, there is no way to properly distinguish it from the
beginning/end of the array.

This also affects the manual page for prev() and next().

This patch should help you a bit:
http://patches.colder.ch/prev-next-current.patch

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

[2006-05-24 03:06:55] phpbug-david at tulloh dot id dot au

Description:
------------
There is a warning box on the documentation for the current()
function.

It talks about the impossibility of differing between the end of the
array and the value zero or "". It is possible to use current() with
these values using the === operator.

The real problem is arrays containing the value false, this isn't
actually mentioned in the warning.

Further the warning suggests using each() instead of current() to get
around these problems, however the two functions aren't really
comparable as each() advances the array cursor.



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


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







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com