PHP 4.0 Bug #7354: Feature Request: sort on single element arrays

From: Date: Thu, 19 Oct 2000 22:23:47 +0000
Subject: PHP 4.0 Bug #7354: Feature Request: sort on single element arrays
Groups: php.dev 
Request: Send a blank email to php-dev+get-35577@lists.php.net to get a copy of this message
From: charlie@screaming-penguin.com Operating system: Linux 2.2.x PHP version: 4.0.3pl1 PHP Bug Type: Feature/Change Request Bug description: Feature Request: sort on single element arrays 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 Bug report at: http://bugs.php.net/?id=7354&edit=1

« previous php.dev (#35577) next »