1--TEST--
2Test scandir() function : usage variations - different ints as $sorting_order arg
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/* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
12 * Description: List files & directories inside the specified path
13 * Source code: ext/standard/dir.c
14 */
15
16/*
17 * Pass different integers as $sorting_order argument to test how scandir()
18 * re-orders the array
19 */
20
21echo "*** Testing scandir() : usage variations ***\n";
22
23// include for create_files/delete_files functions
24include(dirname(__FILE__) . '/../file/file.inc');
25
26// create directory and files
27$dir = dirname(__FILE__) . '/私はガラスを食べられますscandir_variation9';
28mkdir($dir);
29@create_files($dir, 2, "numeric", 0755, 1, "w", "私はガラスを食べられますfile");
30
31// different ints to pass as $sorting_order argument
32$ints = array (PHP_INT_MAX, -PHP_INT_MAX, 0);
33
34foreach($ints as $sorting_order) {
35	var_dump( scandir($dir, $sorting_order) );
36}
37
38delete_files($dir, 2, "私はガラスを食べられますfile");
39?>
40===DONE===
41--CLEAN--
42<?php
43$dir = dirname(__FILE__) . '/私はガラスを食べられますscandir_variation9';
44rmdir($dir);
45?>
46--EXPECT--
47*** Testing scandir() : usage variations ***
48array(4) {
49  [0]=>
50  string(45) "私はガラスを食べられますfile2.tmp"
51  [1]=>
52  string(45) "私はガラスを食べられますfile1.tmp"
53  [2]=>
54  string(2) ".."
55  [3]=>
56  string(1) "."
57}
58array(4) {
59  [0]=>
60  string(45) "私はガラスを食べられますfile2.tmp"
61  [1]=>
62  string(45) "私はガラスを食べられますfile1.tmp"
63  [2]=>
64  string(2) ".."
65  [3]=>
66  string(1) "."
67}
68array(4) {
69  [0]=>
70  string(1) "."
71  [1]=>
72  string(2) ".."
73  [2]=>
74  string(45) "私はガラスを食べられますfile1.tmp"
75  [3]=>
76  string(45) "私はガラスを食べられますfile2.tmp"
77}
78===DONE===
79