php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13567 array_search does not return FALSE as documented, if no entry was found
Submitted: 2001-10-05 14:50 UTC Modified: 2001-10-05 16:14 UTC
From: alvarez at st-oneline dot net Assigned: jeroen (profile)
Status: Closed Package: Arrays related
PHP Version: 4.0.5 OS: Linux 2.2.19
Private report: No CVE-ID: None
 [2001-10-05 14:50 UTC] alvarez at st-oneline dot net
script to reproduce the error quickly:

  // won't produce output, is not boolean FALSE
  if (array_search ('a', array ('b')) === FALSE)
     echo 'is boolean FALSE';

  // won't produce output, is not of type boolean
  if (is_bool (array_search ('a', array ('b'))))
     echo 'is boolean';

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-05 16:05 UTC] jeroen@php.net
Use var_dump to check what's actually returned.

NULL is returned, confirmed with latest CVS.

Assigning to myself
 [2001-10-05 16:14 UTC] jeroen@php.net
Fixed in CVS, will be in 4.0.8, and maybe in 4.0.7

(what's the policy on this kind of bugfixes?)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 04:01:32 2024 UTC