Edit report at https://bugs.php.net/bug.php?id=55061&edit=1
ID: 55061
Comment 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:
Reproduced with the same behaviour and result in Ubuntu 11.10 i386.
Previous Comments:
------------------------------------------------------------------------
[2011-07-29 14:39:20] vovan-ve at yandex dot ru
No, I have no non-official extensions. I have disabled all extensions for test even. May be your int
is not int32?
------------------------------------------------------------------------
[2011-07-27 06:52:24] laruence@php.net
I can not reproduce this warning, do you have non-php-official extension installed?
if yes, plz remove them then check again. thanks
------------------------------------------------------------------------
[2011-06-29 06:03:07] vovan-ve at yandex dot ru
Sorry for typo. var_dymp == var_dump
------------------------------------------------------------------------
[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=55061&edit=1