php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dwilks at intacct dot com
New email:
PHP Version: OS:

 

 [2018-01-09 18:33 UTC] dwilks at intacct dot com
Description:
------------
The documentation for current, each, key, next, prev and reset indicate that the parameter is an array.  It can also be an object.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-25 20:19 UTC] vrana@php.net
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] vrana@php.net
-Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: Arrays related
 [2021-02-12 11:55 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2021-02-12 11:55 UTC] cmb@php.net
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] <https://www.php.net/manual/en/function.array-key-exists.php#refsect1-function.array-key-exists-notes>
 [2021-02-12 12:16 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=a6655e3f9508eee6860b02f55e33560a790f42d1
Log: Fix #75787: Array iterator functions misleading
 [2021-02-12 12:16 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2021-02-13 09:34 UTC] mumumu@php.net
Automatic comment on behalf of mumumu@mumumu.org
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=960ce1d898bf34353d0d1e6c7c84ca75bbfed86b
Log: Fix #75787: Array iterator functions misleading
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC