Re: PHP 4.0 Bug #6684: array_reverse() should maintain indices
| From: | Andrei Zmievski | Date: | Tue, 12 Sep 2000 13:50:27 +0000 |
| Subject: | Re: PHP 4.0 Bug #6684: array_reverse() should maintain indices | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-33053@lists.php.net to get a copy of this message | ||
On Tue, 12 Sep 2000, waldschrott@php.net wrote:
> From: waldschrott@php.net
> Operating system: *
> PHP version: 4.0 Latest CVS (12/09/2000)
> PHP Bug Type: Feature/Change Request
> Bug description: array_reverse() should maintain indices
>
> unfortunately array_reverse doesn´t maintain array indicies and because it´s not that trivial
> to reconstruct them afterwards it would be better to keep them. If you only want the values then you
> can user array_values() on the returned array.
> If not changed completely (backwards compatibilty) it shoul d get another parameter indication
> keys should be preserved.
Is maintaining array indices in this case important? Can you give an
example?
-Andrei
When we eliminate the impossible, whatever remains,
however improbable, must be true. -- Sherlock Holmes