|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-13 00:27 UTC] jian at theorchard dot com
Description:
------------
PHP Bugs: #41685 was not fixed in version 5.2.5 and 5.2.6. I was able to reproduce the problem with this exact code from rob_nicholson at uk dot ibm dot com's example.
Reproduce code:
---------------
<?
$arr = array();
$arr[0x80000000]=8;
$arr[0x7FFFFFFF]=1;
$arr[]="foo";
?>
Expected result:
----------------
array(3) {
[-2147483648]=>
int(8)
[2147483647]=>
int(1)
[0]=>
string(3) "foo"
}
Actual result:
--------------
PHP Warning: array_push(): Cannot add element to the array as the next element is already occupied in C:\test.php on line 6
array(2) {
[-2147483648]=>
int(8)
[2147483647]=>
int(1)
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 20:00:01 2025 UTC |
Ok. So the fix was to add the missing warning. Then the warnings I got from my code doesn't apply to this fix. Ok, here's what happened in my case. I have a small class that is like this below. <? class myClass{ public $drives = array(); public function get_drives(){ $sql = 'CALL some_stored_procedure()'; $result = mysql_query($sql); if(mysql_num_rows($result)){ while($row = mysql_fetch_array($result)){ $this->drives[] = $row['drive_id']; } } } } ?> Line "$this->drives[] = $row['drive_id'];" throws out the same warning. I'm scracthing my head trying to resolve this. Any ideas?