php.net |  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
Votes:3
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-02-06 15:19 UTC] wallacemaxters at gmail dot com
Description:
------------
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?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-19 23:13 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2015-02-19 23:13 UTC] aharvey@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Sun Sep 15 06:01:26 2019 UTC