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
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
48 + 37 = ?
Subscribe to this entry?

 
 [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: Fri Apr 19 16:01:27 2024 UTC