ID:               7354
 Updated by:       [EMAIL PROTECTED]
 Reported By:      charlie at screaming-penguin dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: Linux 2.2.x
 PHP Version:      4.0.3pl1
 New Comment:

I don't know when this has been fixed but in latest
stable CVS this works as you expect. (single element array key is reset
with sort())



Previous Comments:
------------------------------------------------------------------------

[2000-10-19 18:23:47] charlie at screaming-penguin dot com

sort() does not appear to work for arrays that have only a single
element. I am using dynamically built arrays and when an array happens
to have a single element it does not get touched by sort.

This makes sense as far as Why would I want to sort an array with a
single element?  Because I want the indeces reset, not just the values
sorted.  If an array has this structure:

array(1) { [3]=> string(9) "Baltimore" 

then it will not be touched at all by sort and will not be re-indexed
to start at 0.  

It would be nice if sort would sort single element arrays.  



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=7354&edit=1

Reply via email to