php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
22 - 3 = ?
Subscribe to this entry?

 
 [2011-07-21 19:37 UTC] jambroo at gmail dot com
Description:
------------
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 )"

Thanks!

---
From manual page: http://www.php.net/function.array-key-exists%23Description
---



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-17 13:34 UTC] bjori@php.net
-Status: Open +Status: Wont fix
 [2011-08-17 13:34 UTC] bjori@php.net
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: Mon May 27 04:01:31 2024 UTC