ID: 21954
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: RedHat Linux
PHP Version: 4.3.0
New Comment:
This is not a bug, the number you are using is NOT an integer because
it's larger then 2^31-1 (the maximum integer value in PHP) and thus it
will be converted to a float. Use
$a[(string)2163195907] = "hi";
echo array_key_exists((string)2163195907,$a);
and it should work fine.
Derick
Previous Comments:
------------------------------------------------------------------------
[2003-01-29 16:40:18] [EMAIL PROTECTED]
Try this script:
<?php
$a = array();
$a[2163195907] = "hi";
echo array_key_exists(2163195907,$a);
?>
PHP generates a warning (The first argument should be either a string
or an integer). If I try this with smaller integers, the code works
fine. If I convert the integer to a string (using strval), it also
works fine.
Norman Elton
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21954&edit=1