ID:               48254
 Updated by:       matt...@php.net
 Reported By:      for-bugs at hnw dot jp
-Status:           Assigned
+Status:           Closed
 Bug Type:         Arrays related
 Operating System: *
-PHP Version:      5.2, 6CVS (2009-05-13)
+PHP Version:      5.2.9
 Assigned To:      mattwil
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Taken care of now!

I know, Jani, and I've merged other fixes. :-) Just thought this might
be considered, by others, more of a "feature change," since previous bug
reports had been dismissed. And Dmitry, nor anyone else, said anything
about including 5.2 when the change was made in HEAD/5.3 2 months
ago...

Nope, this has nothing to do with the other part missing from HEAD. ;-)
Even though I didn't personally commit this fix, it was done in HEAD as
well. (I've changed the reported version back to 5.2.9)


Previous Comments:
------------------------------------------------------------------------

[2009-05-13 18:40:51] j...@php.net

Matt, bug fixes should go into PHP_5_2. And I guess this is the same 
patch needing MFB to HEAD too? :)

------------------------------------------------------------------------

[2009-05-13 14:25:42] matt...@php.net

See Bug #45877.

This has been fixed in PHP 5.3. I didn't backport the change to 5.2
since it's been around forever and didn't know if the fix would be
wanted in 5.2 (primarily by who's in charge of it) at this point in its
lifecycle.

I'll leave this open for now to see if other devs have a comment...

------------------------------------------------------------------------

[2009-05-13 03:47:05] for-bugs at hnw dot jp

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)
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48254&edit=1

Reply via email to