1--TEST--
2Test rename() function: usage variations-6
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows');
6if (!function_exists("symlink")) die("skip symlinks are not supported");
7?>
8--FILE--
9<?php
10
11$tmp_file = __FILE__.".tmp";
12$tmp_link = __FILE__.".tmp.link";
13$tmp_link2 = __FILE__.".tmp.link2";
14
15touch($tmp_file);
16symlink($tmp_file, $tmp_link);
17rename($tmp_link, $tmp_link2);
18
19clearstatcache();
20
21var_dump(readlink($tmp_link));
22var_dump(readlink($tmp_link2));
23var_dump(file_exists($tmp_file));
24
25@unlink($tmp_link);
26@unlink($tmp_link2);
27@unlink($tmp_file);
28
29echo "Done\n";
30?>
31--EXPECTF--
32Warning: readlink(): No such file or directory in %s on line %d
33bool(false)
34string(%d) "%srename_variation6.php.tmp"
35bool(true)
36Done
37