mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Fixed tests (file order is undefined, so we need to sort() them)
This commit is contained in:
parent
0726c79d7e
commit
0ec1e42e52
@ -23,13 +23,23 @@ create_files($path, 3);
|
||||
|
||||
echo "\n-- Call readdir() with \$path argument --\n";
|
||||
var_dump($dh = opendir($path));
|
||||
$a = array();
|
||||
while( FALSE !== ($file = readdir($dh)) ) {
|
||||
$a[] = $file;
|
||||
}
|
||||
sort($a);
|
||||
foreach($a as $file) {
|
||||
var_dump($file);
|
||||
}
|
||||
|
||||
echo "\n-- Call readdir() without \$path argument --\n";
|
||||
var_dump($dh = opendir($path));
|
||||
$a = array();
|
||||
while( FALSE !== ( $file = readdir() ) ) {
|
||||
$a[] = $file;
|
||||
}
|
||||
sort($a);
|
||||
foreach($a as $file) {
|
||||
var_dump($file);
|
||||
}
|
||||
|
||||
|
@ -31,12 +31,22 @@ $dir_handle1 = opendir($dir_path);
|
||||
opendir($dir_path);
|
||||
|
||||
echo "\n-- Reading Directory Contents with Previous Handle --\n";
|
||||
$a = array();
|
||||
while (FALSE !== ($file = readdir($dir_handle1))) {
|
||||
$a[] = $file;
|
||||
}
|
||||
sort($a);
|
||||
foreach ($a as $file) {
|
||||
var_dump($file);
|
||||
}
|
||||
|
||||
echo "\n-- Reading Directory Contents with Current Handle (no arguments supplied) --\n";
|
||||
$a = array();
|
||||
while (FALSE !== ($file = readdir())) {
|
||||
$a[] = $file;
|
||||
}
|
||||
sort($a);
|
||||
foreach ($a as $file) {
|
||||
var_dump($file);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user