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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jambroo at gmail dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 26 09:01:29 2024 UTC