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