| Bug #21954 | array_key_exists warns for large numeric keys | ||||
|---|---|---|---|---|---|
| Submitted: | 29 Jan 2003 4:40pm UTC | Modified: | 30 Jan 2003 3:46am UTC | ||
| From: | elnormo at hotmail dot com | Assigned to: | |||
| Status: | Bogus | Category: | Arrays related | ||
| Version: | 4.3.0 | OS: | RedHat Linux | ||
[29 Jan 2003 4:40pm UTC] elnormo at hotmail dot com
[30 Jan 2003 3:46am UTC] derick@php.net
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
