1--TEST--
2Test opendir() function : usage variations - open a directory twice
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  : mixed opendir(string $path[, resource $context])
12 * Description: Open a directory and return a dir_handle
13 * Source code: ext/standard/dir.c
14 */
15
16/*
17 * Call opendir() twice with the same directory as $path argument
18 */
19
20echo "*** Testing opendir() : usage variation ***\n";
21
22$path = dirname(__FILE__) . "/私はガラスを食べられますopendir_variation3";
23mkdir($path);
24
25echo "\n-- Open directory first time: --\n";
26var_dump($dh1 = opendir($path));
27
28echo "\n-- Open directory second time: --\n";
29var_dump($dh2 = opendir($path));
30
31if ($dh1 !== $dh2) {
32	echo "\nNew resource created\n";
33} else {
34	echo "\nNo new resource created\n";
35}
36
37closedir($dh1);
38closedir($dh2);
39?>
40===DONE===
41--CLEAN--
42<?php
43$path = dirname(__FILE__) . "/私はガラスを食べられますopendir_variation3";
44rmdir($path);
45?>
46--EXPECTF--
47*** Testing opendir() : usage variation ***
48
49-- Open directory first time: --
50resource(%d) of type (stream)
51
52-- Open directory second time: --
53resource(%d) of type (stream)
54
55New resource created
56===DONE===
57