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
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: wallacemaxters at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 27 03:01:30 2024 UTC