From:             jahangiri dot hamid at gmail dot com
Operating system: win 7
PHP version:      5.3Git-2013-01-29 (Git)
Package:          *General Issues
Bug Type:         Bug
Bug description:in_array does not work correct

Description:
------------
---
>From manual page:
http://www.php.net/function.in-array#refsect1-function.in-array-
returnvalues
---
in_array doesnot work properly 


Test script:
---------------
my array : array is result of print_r of my real array
$arrayvar = Array ( [0] => 90 [1] => a [2] => [3] => 1 [4] => b [5] =>
[6] => 2 [7] => c [8] => [9] => 4 [10] => d [11] => [12] => 6 [13] => e
[14] => [15] => 7 [16] => f [17] => [18] => 8 [19] => g [20] => [21] => 9
[22] => h [23] => [24] => 10 [25] => i [26] => [27] => 11 [28] => j [29] =>
[30] => 12 [31] => k [32] => [33] => 14 [34] => l [35] => [36] => 100 [37]
=> m [38] => )

my needle : $key=90;

my code :
in_array($key,$arrayvar);
it return false

Expected result:
----------------
true

Actual result:
--------------
false

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64095&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64095&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64095&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64095&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64095&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64095&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64095&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64095&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64095&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64095&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64095&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64095&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64095&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64095&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64095&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64095&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64095&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64095&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64095&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64095&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64095&r=mysqlcfg

Reply via email to