#36975 [NEW]: natcasesort

From: Date: Tue, 04 Apr 2006 21:06:37 +0000
Subject: #36975 [NEW]: natcasesort
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95320@lists.php.net to get a copy of this message
From: ateixeira at gmail dot com Operating system: Linux 2.6.11 PHP version: 5.1.2 PHP Bug Type: Arrays related Bug description: natcasesort Description: ------------ After using natcasesort, using the array_pop and array_push (or arr[] = $value construct) in conjunction cause the following error (on array_push): Warning: Cannot add element to the array as the next element is already occupied in xxxxx.php on Line xx Also, the value doesn't get pushed onto the array. Reproduce code: --------------- $fileList = array('aa', 'aa', 'bb', 'bb', 'cc', 'cc'); $test = natcasesort($fileList); if ($test) { echo "natcasesort success!\n"; } $val = array_pop($fileList); $fileList[] = $val; print_r($fileList); Expected result: ---------------- natcasesort success! Array ( [0] => aa [1] => aa [2] => bb [3] => bb [4] => cc [5] => cc ) Actual result: -------------- natcasesort success! PHP Warning: Cannot add element to the array as the next element is already occupied in /webroot/root/projects/RPMfe/j.php on line 10 Warning: Cannot add element to the array as the next element is already occupied in /webroot/root/projects/RPMfe/j.php on line 10 Array ( [0] => aa [1] => aa [3] => bb [2] => bb [5] => cc ) -- Edit bug report at http://bugs.php.net/?id=36975&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36975&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36975&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36975&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36975&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36975&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36975&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36975&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36975&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36975&r=support Expected behavior: http://bugs.php.net/fix.php?id=36975&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36975&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36975&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36975&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36975&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36975&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36975&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36975&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36975&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36975&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36975&r=mysqlcfg

« previous php.bugs (#95320) next »