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-08-13 12:21 UTC
From: mumumu@php.net Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 21 = ?
Subscribe to this entry?

 
 [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
 [2020-08-13 12:21 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-08-13 12:21 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2020-08-13 12:22 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=fbde32f84bff5388c325d513c44976542015c049
Log: Fix #79054: Wrong indistinguishable point about current() function
 [2020-08-14 01:50 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=6699b411367e1df2a30c1b028dac57b3b3ab457b
Log: Fix #79054: Wrong indistinguishable point about current() function
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=2c0472d51dd84a452dd5f2cf4e26e3dbd130e744
Log: Fix #79054: Wrong indistinguishable point about current() function
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC