File: opendir_variation3-win32-mb.phpt

package info (click to toggle)
php8.4 8.4.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 211,276 kB
  • sloc: ansic: 1,176,142; php: 35,419; sh: 11,964; cpp: 7,208; pascal: 4,951; javascript: 3,091; asm: 2,817; yacc: 2,411; makefile: 696; xml: 446; python: 301; awk: 148
file content (49 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--TEST--
Test opendir() function : usage variations - open a directory twice
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
  die("skip Valid only on Windows");
}
?>
--FILE--
<?php
/*
 * Call opendir() twice with the same directory as $path argument
 */

echo "*** Testing opendir() : usage variation ***\n";

$path = __DIR__ . "/私はガラスを食べられますopendir_variation3";
mkdir($path);

echo "\n-- Open directory first time: --\n";
var_dump($dh1 = opendir($path));

echo "\n-- Open directory second time: --\n";
var_dump($dh2 = opendir($path));

if ($dh1 !== $dh2) {
    echo "\nNew resource created\n";
} else {
    echo "\nNo new resource created\n";
}

closedir($dh1);
closedir($dh2);
?>
--CLEAN--
<?php
$path = __DIR__ . "/私はガラスを食べられますopendir_variation3";
rmdir($path);
?>
--EXPECTF--
*** Testing opendir() : usage variation ***

-- Open directory first time: --
resource(%d) of type (stream)

-- Open directory second time: --
resource(%d) of type (stream)

New resource created