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
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: 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 09:01:35 2025 UTC