|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55263 array-key-exists description uses "$key, $search" not "$needle, $haystack"
Submitted: 2011-07-21 19:37 UTC Modified: 2011-08-17 13:34 UTC
From: jambroo at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.3.6 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.
Block user comment
Status: Assign to:
Bug Type:
From: jambroo at gmail dot com
New email:
PHP Version: OS:


 [2011-07-21 19:37 UTC] jambroo at gmail dot com
It would be greate for the method description to read:
"bool array_key_exists ( mixed $needle , array $haystack )"
instead of
"bool array_key_exists ( mixed $key , array $search )"

Similar to:
"string strstr ( string $haystack , mixed $needle [, bool $before_needle = false 
] )"
"mixed array_search ( mixed $needle , array $haystack [, bool $strict = false ] 
"string strrchr ( string $haystack , mixed $needle )"


From manual page:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-17 13:34 UTC]
-Status: Open +Status: Wont fix
 [2011-08-17 13:34 UTC]
Its quite intentionally not $needle $haystack, as that implies searching in its 
values. The function checks if a key exists - the whole name, not a subset of it 
the string or anything along those lines.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 11:01:28 2024 UTC