From: edschouten at il dot fontys dot nl
Operating system: Gentoo Linux
PHP version: 4.3.6
PHP Bug Type: Unknown/Other Function
Bug description: array_search doesn't work with file
Description:
------------
The array_search function works fine when searching through regular
arrays, but when you try to search with it from an array made with file(),
it doesn't find anything.
Reproduce code:
---------------
example.list:
1
2
3
4
5
bug.php:
<?
$list = file('example.list');
print array_search('2', $list);
?>
Expected result:
----------------
1
Actual result:
--------------
<nothing>
--
Edit bug report at http://bugs.php.net/?id=28130&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28130&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28130&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28130&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28130&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28130&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28130&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28130&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28130&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28130&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28130&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28130&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28130&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28130&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28130&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28130&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28130&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28130&r=float