|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75787 Array iterator functions misleading
Submitted: 2018-01-09 18:33 UTC Modified: 2021-02-12 11:55 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dwilks at intacct dot com Assigned: cmb (profile)
Status: Closed Package: Arrays related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2018-01-09 18:33 UTC] dwilks at intacct dot com
The documentation for current, each, key, next, prev and reset indicate that the parameter is an array.  It can also be an object.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-25 20:19 UTC]
It's also true for end, array_key_exists, array_walk, array_walk_recursive. There's no limitation on the object (i.e. it doesn't need to implement any interface).
 [2018-01-31 10:28 UTC]
-Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: Arrays related
 [2021-02-12 11:55 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2021-02-12 11:55 UTC]
The documentation has mostly been fixed in the meantime (except
for each()).  For array_key_exists() there is already a respective
note[1]; this should be clarified (explicitly deprecated as of PHP
7.4.0, no longer supported as of PHP 8.0.0).

[1] <>
 [2021-02-12 12:16 UTC]
Automatic comment on behalf of
Log: Fix #75787: Array iterator functions misleading
 [2021-02-12 12:16 UTC]
-Status: Verified +Status: Closed
 [2021-02-13 09:34 UTC]
Automatic comment on behalf of
Log: Fix #75787: Array iterator functions misleading
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Mar 07 15:01:23 2021 UTC