array_key_exists with float keys (bug #60039)
| From: | Nikita Popov | Date: | Fri, 11 Nov 2011 21:40:27 +0000 |
| Subject: | array_key_exists with float keys (bug #60039) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-56290@lists.php.net to get a copy of this message | ||
Hi internals!
I'd like to get some attention to bug #60039 [1]. It is about the
behavior of array_key_exists with "unusual" keys like floats, bools
and resources. Currently array_key_exists throws a warning if such a
key is passed. isset() on the other hand (and native array accesses in
general) treat them as valid keys, with floats being converted to ints
and bools and resources treated just like ints.
I would like to see array_key_exists behave consistent with
isset($array[$key]) / $array[$key]. The bug has a patch attached that
does this.
I don't think that this change has any BC impact as it only *removes* warnings.
Nikita
[1]: https://bugs.php.net/bug.php?id=60039