Doc #79054 [Asn->Csd]: Wrong indistinguishable point about current() function
| From: | cmb@php.net | Date: | Thu, 13 Aug 2020 12:21:43 +0000 |
| Subject: | Doc #79054 [Asn->Csd]: Wrong indistinguishable point about current() function | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17774@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79054&edit=1
ID: 79054
Updated by: cmb@php.net
Reported by: mumumu@php.net
Summary: Wrong indistinguishable point about current()
function
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Fixed with <http://svn.php.net/viewvc?view=revision&revision=350305>.
Previous Comments:
------------------------------------------------------------------------
[2020-01-02 09:44:45] mumumu@php.net
Description:
------------
https://www.php.net/manual/en/function.current.php
We describe wrong indistinguishable point about current() function.
When array points the end of an array, current() returns not boolean false but the last element.
Index: reference/array/functions/current.xml
===================================================================
--- reference/array/functions/current.xml (revision 348749)
+++ reference/array/functions/current.xml (working copy)
@@ -99,8 +99,8 @@
&reftitle.notes;
<note>
<simpara>
- The end of an array and the result of calling
- <function>current</function> on an empty array
+ The result of calling <function>current</function> on an empty array
+ and array pointing beyond the end of the elements
are indistinguishable from a <type>boolean</type> &false; element.
To properly traverse an array which may contain &false; elements, see the
<function>foreach</function> function.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79054&edit=1