php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40082 array_search_keys returns a zero value element
Submitted: 2007-01-09 20:40 UTC Modified: 2007-01-09 22:23 UTC
From: paulnamuag at yahoo dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.2.0 OS: Linux
Private report: No CVE-ID: None
 [2007-01-09 20:40 UTC] paulnamuag at yahoo dot com
Description:
------------
    $array = array( "field1" => 0, "field2" => "This is a string" );

$result = array_search( "This is a string", $array );

print_r( $result ); // Outputs "field1", not "field2"






Expected result:
----------------
    $array = array( "field1" => 0, "field2" => "This is a string" );

$result = array_search( "This is a string", $array );

print_r( $result ); // Outputs "field2"




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-09 22:23 UTC] iliaa@php.net
Seems to work fine in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 01:01:29 2024 UTC