|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18259 array_search doesnt search in arrayindex[0]
Submitted: 2002-07-10 05:13 UTC Modified: 2002-07-10 06:02 UTC
From: schizo at psykick dot de Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.2.1 OS: Windows2000
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 !
Your email address:
Solve the problem:
14 - 9 = ?
Subscribe to this entry?

 [2002-07-10 05:13 UTC] schizo at psykick dot de
array_search doesnt search the first index (0) of an array.
url: test.php?action=new&state=ok&module=1

//merge is not the problem

//result: true -> its ok

//result: false -> BUG

array_keys() works correct (I checked this), the problem is the array_search().


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-10 06:02 UTC]
It doesn't return false, it returns 0 (because the value you're looking for has index 0). 0 evaluates to false. Use array_search(...) === false.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 16:03:35 2021 UTC