|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68995 description of the "current" confused function in manual
Submitted: 2015-02-06 15:19 UTC Modified: 2015-02-19 23:13 UTC
Avg. Score:4.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: wallacemaxters at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.4.37 OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: wallacemaxters at gmail dot com
New email:
PHP Version: OS:


 [2015-02-06 15:19 UTC] wallacemaxters at gmail dot com
why when I use "current (1)", it returns "current () Expects parameter 1 to be array, integer given"; however, when using "current (new stdClass)", it returns "false"?

In manual, the current function is exemplified as follows:

mixed current (array & $ array)

At first, this might lead one to think that it only accepts array passed by reference as parameter.

If this is the correct operation of the function, is there any possibility to change this statement in the manual?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-19 23:13 UTC]
-Status: Open +Status: Wont fix
 [2015-02-19 23:13 UTC]
Non-iterator objects are iterable like arrays, mostly for BC reasons. This is expected behaviour, but I don't think we should change the manual page to note that — effectively, it'll be treated like an array regardless, and it's confusing.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 05:01:31 2024 UTC