php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79054 Wrong indistinguishable point about current() function
Submitted: 2020-01-02 09:44 UTC Modified: 2020-01-02 09:52 UTC
From: mumumu@php.net Assigned:
Status: Open Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mumumu@php.net
New email:
PHP Version: OS:

 

 [2020-01-02 09:44 UTC] 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.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-02 09:52 UTC] mumumu@php.net
-Operating System: +Operating System: Irrelevant
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 18:01:26 2020 UTC