blob: 0b81be6a0659716c930baf4bcee28f492e731bf7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--TEST--
Bug#44806 (rename() function is not portable to Windows)
--FILE--
<?php
$dirname = __DIR__;
$file1 = $dirname . DIRECTORY_SEPARATOR . "file1.txt";
$file2 = $dirname . DIRECTORY_SEPARATOR . "file2.txt";
file_put_contents($file1, "this is file 1");
file_put_contents($file2, "this is file 2");
rename($file1, $file2);
echo "reading file 2: ";
readfile($file2);
if (file_exists($file1)) {
unlink($file1);
}
if (file_exists($file2)) {
unlink($file2);
}
?>
--EXPECT--
reading file 2: this is file 1
|