php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9458 in_array() error
Submitted: 2001-02-26 07:42 UTC Modified: 2001-02-26 07:45 UTC
From: tf at tfromm dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.0.3pl1 OS: linux 2.2.x 2.4.x
Private report: No CVE-ID: None
 [2001-02-26 07:42 UTC] tf at tfromm dot com
comparison problem in in_array() function

<?php
$a="foo";
$b=array(1, 4, 6);
if(in_array($a, $b)){
	echo "BAR!";
}
?>

is a little bit confusing, espacially for user, who comes from other  programming languages ...
(seems not to be a feature ;-)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-26 07:45 UTC] stas@php.net
Do not see any problem here. in_array returns for me false,
as it should. This bug seems to be fixed or you have some
other problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC