From:             rob_nicholson at uk dot ibm dot com
Operating system: all
PHP version:      5.2.3
PHP Bug Type:     Arrays related
Bug description:  Missing WARNING in array_push where next index is used.

Description:
------------
This testcase produces a warning:

<?php

$arr = array();
$arr[0x80000000]=8;
$arr[0x7FFFFFFF]=1;
$arr[]="foo";
?>

Output is:

WARNING: Cannot add element to the array as the next element is already
occupied in  g:\foo.php on line 6.

This equivalent testcase produces no warning.

<?php

$arr = array();
$arr[0x80000000]=8;
$arr[0x7FFFFFFF]=1;

array_push ($arr,"foo","bar");
var_dump($arr);
?>







Reproduce code:
---------------
<?php

$arr = array();
$arr[0x80000000]=8;
$arr[0x7FFFFFFF]=1;

array_push ($arr,"foo","bar");
var_dump($arr);
?>


Expected result:
----------------
WARNING: Cannot add element to the array as the next element is already
occupied in  g:\foo.php on line 6.
array(2) {
  [-2147483648]=>
  int(8)
  [2147483647]=>
  int(1)
}


Actual result:
--------------
array(2) {
  [-2147483648]=>
  int(8)
  [2147483647]=>
  int(1)
}

-- 
Edit bug report at http://bugs.php.net/?id=41685&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41685&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41685&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41685&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41685&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41685&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41685&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41685&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41685&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41685&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41685&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41685&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41685&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41685&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41685&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41685&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41685&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41685&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41685&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41685&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41685&r=mysqlcfg

Reply via email to