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
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: 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-2025 The PHP Group
All rights reserved.
Last updated: Tue Mar 11 06:01:29 2025 UTC