php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61762 document problem
Submitted: 2012-04-18 09:45 UTC Modified: 2012-04-19 07:11 UTC
From: frankcoal at gmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.4.0 OS: window xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: frankcoal at gmail dot com
New email:
PHP Version: OS:

 

 [2012-04-18 09:45 UTC] frankcoal at gmail dot com
Description:
------------
in the document description said that:
Version	Description
4.2.0	 Prior to PHP 4.2.0, array_search() returns NULL on failure instead of FALSE.

in my windows xp system,the php version is 5.2.0,but i found the returns Value is already NULL,perhaps this is problem? perhaps, Prior to PHP 5.2.0,array_search() returns NULL on failure instead of FALSE.

ok,that is all!
 




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-19 07:11 UTC] aharvey@php.net
-Status: Open +Status: Not a bug -Package: *Regular Expressions +Package: Arrays related
 [2012-04-19 07:11 UTC] aharvey@php.net
I believe you're mistaken:

<?php
$a = array(1, 2);
var_dump(array_search(1, $a, true));
var_dump(array_search(3, $a, true));
?>

Prints:

int(0)
bool(false)

Which lines up with the documentation.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 22:01:33 2025 UTC