From:             micheal dot winger at gmail dot com
Operating system: Windows XP Home
PHP version:      5.1.2
PHP Bug Type:     Feature/Change Request
Bug description:  Incorrect handling of multi-dimensional array increments

Description:
------------
When working with multi-dimensional arrays without keys.. it ignores the
2-nd dimension and only increments the first.

Reproduce code:
---------------
$array[][]="blah";
$array[][]="2nd";

print_r($array);

Expected result:
----------------
I expect to see this on the website:

Array ( 
[0] => Array ( [0] => blah ) 
[0] => Array ( [1] => 2nd ) 
)

Actual result:
--------------
Array ( 
[0] => Array ( [0] => blah ) 
[1] => Array ( [0] => 2nd ) 
)

Notice that it is only incrementing the first array. I feel this is a
problem since you can do $array[][] in the code, but then it renders
useless if you want to have more than one value in the 2nd array, making
it impossible to use this method.

If possible, make it work like the expected result, and then add a small
function just to jump the first array up.. but give support for higher
than 2d arrays, allowing the user to specify which layer the user wants to
increment.

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

Reply via email to