Edit report at https://bugs.php.net/bug.php?id=60006&edit=1
ID: 60006
User updated by: vovan-ve at yandex dot ru
Reported by: vovan-ve at yandex dot ru
Summary: Array autoindex[] overflow
Status: Open
Type: Bug
Package: Arrays related
Operating System: WindowsXP SP3
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
Sorry for typo. var_dymp == var_dump
Previous Comments:
------------------------------------------------------------------------
[2011-06-29 04:47:05] vovan-ve at yandex dot ru
Description:
------------
There is a test code:
$a = array(0x7FFFFFFF => 42);
$a[] = 37;
var_dymp($a);
Second line emits warning:
Warning: Cannot add element to the array as the next element
is already occupied in ... on line 2
and doesn't add element with value 37. This is absolutely abnormal
behaviour. At least there is incorrect text for Warning. I expect,
the element should be added with any index (i.e. string "2147483648"
as the result of 0x7FFFFFFF+1 thru float), or something else. But
element was not added even.
Test script:
---------------
$a = array(0x7FFFFFFF => 42);
$a[] = 37;
var_dymp($a);
Expected result:
----------------
array(1) {
[2147483647]=>
int(42)
["2147483648"]=>
int(37)
}
OR (when int will become int64):
array(1) {
[2147483647]=>
int(42)
[2147483648]=>
int(37)
}
Actual result:
--------------
Warning: Cannot add element to the array as the next element is already
occupied in ... on line 2
array(1) {
[2147483647]=>
int(42)
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60006&edit=1