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
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: alvarez at st-oneline dot net
New email:
PHP Version: OS:

 

 [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: Tue May 07 16:01:35 2024 UTC