1--TEST--
2Test dir() function : usage variations - operate on previously opened directory
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 * Testing the behavior of dir() function by trying to open a
13 * directory which is already open.
14 */
15
16echo "*** Testing dir() : operate on previously opened directory ***\n";
17
18// include the file.inc for Function: function create_files()
19include( __DIR__."/../file/file.inc");
20
21// create the temporary directory
22$file_path = __DIR__;
23$dir_path = $file_path."/私はガラスを食べられますdir_variation4";
24@mkdir($dir_path);
25
26// create files within the temporary directory
27create_files($dir_path, 3, "alphanumeric", 0755, 1, "w", "私はガラスを食べられますdir_variation4");
28
29// open the directory
30$d = dir($dir_path);
31var_dump( $d );
32
33// open the same directory again without closing it
34$e = dir($dir_path);
35var_dump( $e );
36
37echo "-- reading directory contents with previous handle --\n";
38var_dump( $d->read() ); // with previous handle
39
40echo "-- reading directory contents with current handle --\n";
41var_dump( $e->read() ); // with current handle
42
43// delete temporary files
44delete_files($dir_path, 3, "私はガラスを食べられますdir_variation4");
45echo "Done";
46?>
47--CLEAN--
48<?php
49$file_path = __DIR__;
50$dir_path = $file_path."/私はガラスを食べられますdir_variation4";
51
52rmdir($dir_path);
53?>
54--EXPECTF--
55*** Testing dir() : operate on previously opened directory ***
56object(Directory)#%d (2) {
57  ["path"]=>
58  string(%d) "%s/私はガラスを食べられますdir_variation4"
59  ["handle"]=>
60  resource(%d) of type (stream)
61}
62object(Directory)#%d (2) {
63  ["path"]=>
64  string(%d) "%s/私はガラスを食べられますdir_variation4"
65  ["handle"]=>
66  resource(%d) of type (stream)
67}
68-- reading directory contents with previous handle --
69string(%d) "%s"
70-- reading directory contents with current handle --
71string(%d) "%s"
72Done
73