#44825 [NEW]: array_key_exists() The first argument should be either a string or an integer
| From: | dmitrij at stepanov dot lv | Date: | Thu, 24 Apr 2008 21:41:58 +0000 |
| Subject: | #44825 [NEW]: array_key_exists() The first argument should be either a string or an integer | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-124496@lists.php.net to get a copy of this message | ||
From: dmitrij at stepanov dot lv
Operating system: Windows XP
PHP version: 5.2.5
PHP Bug Type: Unknown/Other Function
Bug description: array_key_exists() The first argument should be either a string or an integer
Description:
------------
array_key_exists() does not accept float as a key. (The first argument
should be either a string or an integer), however it is possible to use
floats as keys.
Reproduce code:
---------------
$array =array(
3.15 =>20);
var_dump( array_key_exists( 3.15, $array)) ."\n";// ERROR: The first
argument should be either a string or an integer
echo $array[3.15];//OK
Expected result:
----------------
boolean(true)
20
Actual result:
--------------
blahblahblah
20
--
Edit bug report at http://bugs.php.net/?id=44825&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44825&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44825&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44825&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44825&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44825&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44825&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44825&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44825&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44825&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44825&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44825&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44825&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44825&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44825&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44825&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44825&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44825&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44825&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44825&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44825&r=mysqlcfg