|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-06-29 06:03 UTC] vovan-ve at yandex dot ru
[2011-07-27 06:52 UTC] laruence@php.net
[2011-07-29 14:39 UTC] vovan-ve at yandex dot ru
[2012-02-27 23:45 UTC] vovan-ve at yandex dot ru
[2012-07-03 15:45 UTC] pollita@php.net
-Status: Open
+Status: Verified
[2012-07-03 15:45 UTC] pollita@php.net
[2014-07-15 11:58 UTC] yohgaki@php.net
-Operating System: WindowsXP SP3
+Operating System: Windows and 32bit OS
-PHP Version: 5.3.6
+PHP Version: *
[2014-07-15 11:58 UTC] yohgaki@php.net
[2014-07-15 12:00 UTC] yohgaki@php.net
[2014-07-15 12:21 UTC] vovan-ve at yandex dot ru
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 08:00:02 2025 UTC |
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) }