|  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
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.
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: Wed May 22 07:01:34 2024 UTC