1--TEST--
2Test scandir() function : basic functionality
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') {
6  die("skip Valid only on Windows");
7}
8?>
9--FILE--
10<?php
11/*
12 * Test basic functionality of scandir()
13 */
14
15echo "*** Testing scandir() : basic functionality ***\n";
16
17// include file.inc for create_files function
18include (__DIR__ . '/../file/file.inc');
19
20// set up directory
21$directory = __DIR__ . '/私はガラスを食べられますscandir_basic';
22mkdir($directory);
23create_files($directory, 3, "numeric", 0755, 1, "w", "私はガラスを食べられますfile");
24
25echo "\n-- scandir() with mandatory arguments --\n";
26var_dump(scandir($directory));
27
28echo "\n-- scandir() with all arguments --\n";
29$sorting_order = SCANDIR_SORT_DESCENDING;
30$context = stream_context_create();
31var_dump(scandir($directory, $sorting_order, $context));
32
33delete_files($directory, 3, "私はガラスを食べられますfile");
34?>
35--CLEAN--
36<?php
37$directory = __DIR__ . '/私はガラスを食べられますscandir_basic';
38rmdir($directory);
39?>
40--EXPECT--
41*** Testing scandir() : basic functionality ***
42
43-- scandir() with mandatory arguments --
44array(5) {
45  [0]=>
46  string(1) "."
47  [1]=>
48  string(2) ".."
49  [2]=>
50  string(45) "私はガラスを食べられますfile1.tmp"
51  [3]=>
52  string(45) "私はガラスを食べられますfile2.tmp"
53  [4]=>
54  string(45) "私はガラスを食べられますfile3.tmp"
55}
56
57-- scandir() with all arguments --
58array(5) {
59  [0]=>
60  string(45) "私はガラスを食べられますfile3.tmp"
61  [1]=>
62  string(45) "私はガラスを食べられますfile2.tmp"
63  [2]=>
64  string(45) "私はガラスを食べられますfile1.tmp"
65  [3]=>
66  string(2) ".."
67  [4]=>
68  string(1) "."
69}
70