HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cloudlinux/alt-php54/root/usr/share/pear/test/File_Util/tests/Util/sortFiles.phpt
--TEST--
File_Util::listDir() with sorting
--FILE--
<?php
// $Id: $
require_once 'File/Util.php';

$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'listDir';
$dirs = File_Util::listDir($dir, FILE_LIST_ALL &~ FILE_LIST_DOTS, FILE_SORT_REVERSE | FILE_SORT_SIZE);
foreach ($dirs as $k => $v) {
  unset($dirs[$k]->date); // date is modified time, can't be tested for reliably
}
print_r($dirs);
?>
--EXPECT--
Array
(
    [0] => stdClass Object
        (
            [name] => parser.php
            [size] => 577
        )

    [1] => stdClass Object
        (
            [name] => test.csv
            [size] => 537
        )

    [2] => stdClass Object
        (
            [name] => bug14030-to-delete.csv
            [size] => 161
        )

)