1--TEST--
2Test scandir() function : usage variations - different ints as $sorting_order arg
3--FILE--
4<?php
5/*
6 * Pass different integers as $sorting_order argument to test how scandir()
7 * re-orders the array
8 */
9
10echo "*** Testing scandir() : usage variations ***\n";
11
12// include for create_files/delete_files functions
13include(__DIR__ . '/../file/file.inc');
14
15// create directory and files
16$dir = __DIR__ . '/scandir_variation9';
17mkdir($dir);
18@create_files($dir, 2);
19
20// different ints to pass as $sorting_order argument
21$ints = array (PHP_INT_MAX, -PHP_INT_MAX, 0);
22
23foreach($ints as $sorting_order) {
24    var_dump( scandir($dir, $sorting_order) );
25}
26
27delete_files($dir, 2);
28?>
29--CLEAN--
30<?php
31$dir = __DIR__ . '/scandir_variation9';
32rmdir($dir);
33?>
34--EXPECT--
35*** Testing scandir() : usage variations ***
36array(4) {
37  [0]=>
38  string(9) "file2.tmp"
39  [1]=>
40  string(9) "file1.tmp"
41  [2]=>
42  string(2) ".."
43  [3]=>
44  string(1) "."
45}
46array(4) {
47  [0]=>
48  string(9) "file2.tmp"
49  [1]=>
50  string(9) "file1.tmp"
51  [2]=>
52  string(2) ".."
53  [3]=>
54  string(1) "."
55}
56array(4) {
57  [0]=>
58  string(1) "."
59  [1]=>
60  string(2) ".."
61  [2]=>
62  string(9) "file1.tmp"
63  [3]=>
64  string(9) "file2.tmp"
65}
66