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
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: tf at tfromm dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 14:01:32 2024 UTC