|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-13 14:25 UTC] mattwil@php.net
[2009-05-13 18:40 UTC] jani@php.net
[2009-05-14 01:42 UTC] mattwil@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
Description: ------------ There is inconsistency in dealing with huge numerical array key. We know PHP normalizes array key with numerical string to integer if possible. For instance, $a["1"] is equevalent to $a[1]. However, it is not valid about PHP_INT_MAX and ~PHP_INT_MAX (2147483647 and -2147483648 in 32bit envirionment). Reproduce code: --------------- <?php $a[PHP_INT_MAX]=1; $a[(string)PHP_INT_MAX]=2; var_dump($a); Expected result: ---------------- array(2) { [2147483647]=> int(2) } Actual result: -------------- array(2) { [2147483647]=> int(1) ["2147483647"]=> int(2) }