1--TEST--
2Test rewinddir() function : usage variations - operate on a closed 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/* Prototype  : void rewinddir([resource $dir_handle])
12 * Description: Rewind dir_handle back to the start
13 * Source code: ext/standard/dir.c
14 * Alias to functions: rewind
15 */
16
17/*
18 * Open and close a directory handle then call rewinddir() to test behaviour
19 */
20
21echo "*** Testing rewinddir() : usage variations ***\n";
22
23$dir_path = __DIR__ . '/私はガラスを食べられますrewinddir_variation2';
24mkdir($dir_path);
25
26echo "\n-- Create the directory handle, read and close the directory --\n";
27var_dump($dir_handle = opendir($dir_path));
28var_dump(readdir($dir_handle));
29closedir($dir_handle);
30
31echo "\n-- Call to rewinddir() --\n";
32var_dump(rewinddir($dir_handle));
33?>
34===DONE===
35--CLEAN--
36<?php
37$dir_path = __DIR__ . '/私はガラスを食べられますrewinddir_variation2';
38rmdir($dir_path);
39?>
40--EXPECTF--
41*** Testing rewinddir() : usage variations ***
42
43-- Create the directory handle, read and close the directory --
44resource(%d) of type (stream)
45string(%d) "%s"
46
47-- Call to rewinddir() --
48
49Warning: rewinddir(): %s is not a valid Directory resource in %s on line %d
50bool(false)
51===DONE===
52