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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Jul 21 01:01:28 2024 UTC