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
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: 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

Pull Requests

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 Oct 18 02:01:27 2024 UTC