php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33382 array_reverse don't work after natsort
Submitted: 2005-06-17 10:49 UTC Modified: 2005-06-17 12:53 UTC
From: n dot escuder at intra-links dot com Assigned: tony2001 (profile)
Status: Closed Package: Arrays related
PHP Version: 5CVS-2005-06-17 (dev) OS: Linux
Private report: No CVE-ID: None
 [2005-06-17 10:49 UTC] n dot escuder at intra-links dot com
Description:
------------
A bug occur after doing a natsort and an array_reverse.

after the natsort all seem to be good but after array_reverse not.

If we don't use natsort all work fine.



Reproduce code:
---------------
<?

$test = array ("/", "/mnt", "/tmp");

natsort($test);
print_r($test);
$test = array_reverse($test);

print_r($test);

?>

Expected result:
----------------
Array
(
    [0] => /
    [1] => /mnt
    [2] => /tmp
)

Array
(
    [0] => /tmp
    [1] => /mnt
    [2] => /
)

Actual result:
--------------
Array
(
    [0] => /
    [1] => /mnt
    [2] => /tmp
)

Array
(
    [0] => /tmp
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-17 12:40 UTC] tony2001@php.net
Assigning to myself.
Patch pending.
 [2005-06-17 12:53 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC