|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-14 02:09 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Feb 12 10:00:02 2026 UTC |
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.